inconsistency and inefficiency in setup_conversion()
Taking a close look at the result of setup_conversion(), wrong or at
least confusing comments are applied to the functions. Consider this
family of conversions:
select conproc, conname
from pg_conversion
where conproc = 'utf8_to_win'::regproc
order by oid;
conproc | conname
-------------+----------------------
utf8_to_win | utf8_to_windows_866
utf8_to_win | utf8_to_windows_874
utf8_to_win | utf8_to_windows_1250
utf8_to_win | utf8_to_windows_1251
utf8_to_win | utf8_to_windows_1252
utf8_to_win | utf8_to_windows_1253
utf8_to_win | utf8_to_windows_1254
utf8_to_win | utf8_to_windows_1255
utf8_to_win | utf8_to_windows_1256
utf8_to_win | utf8_to_windows_1257
utf8_to_win | utf8_to_windows_1258
(11 rows)
Then compare the comment on the function:
select proname, description
from pg_description d
join pg_proc p on d.objoid=p.oid
where classoid = 'pg_proc'::regclass
and description ~ 'for UTF8 to WIN';
proname | description
-------------+--------------------------------------------------
utf8_to_win | internal conversion function for UTF8 to WIN1258
(1 row)
Notice how the comment refers to the last encoding created. This is
because setup_conversion.sql invokes CREATE OR REPLACE FUNCTION
utf8_to_win [...] multiple times, each with different comments
specific to the encoding. It'd be messy at best to try to construct
the right comment using the current Makefile script. It also can't be
good for initdb performance to create 44 functions just to immediately
drop them. Speaking of, from this thread about initdb performance [1]/messages/by-id/b549c8ad-f12e-aad1-9a59-b24cb3e55a17@proxel.se,
setup_conversion() consumed the biggest share of time. I propose to
get rid of the ad hoc $(CONVERSIONS) format and solve the comment
issue, while hopefully shaving a bit more time off of initdb. It seems
our options are the following:
Solution #1 - As alluded to in [1]/messages/by-id/b549c8ad-f12e-aad1-9a59-b24cb3e55a17@proxel.se, turn the conversions into
pg_proc.dat and pg_conversion.dat entries. Teach genbki.pl to parse
pg_wchar.h to map conversion names to numbers.
Pros:
-likely easy to do
-allows for the removal of an install target in the Makefile as well
as ad hoc logic in MSVC
-uses a format that developers need to use anyway
Cons:
-immediately burns up 88 hard-coded OIDs and one for each time a
conversion proc is created
-would require editing data in two catalogs every time a conversion
proc is created
Solution #2 - Write a new script that would read all the .c files in
the various directories and output two files. These would be COPY'd
into temp tables during initdb, and then inserted into pg_proc,
pg_conversion, and pg_description using SQL.
Pros:
-eliminates all(?) manual catalog maintenance when adding new conversion procs
Cons:
-likely complex and difficult to debug
-further complicates initdb.c
-requires MSVC development
If we do anything, I'd much rather do #1, but that way is not entirely
without downsides compared to doing nothing. Any thoughts?
[1]: /messages/by-id/b549c8ad-f12e-aad1-9a59-b24cb3e55a17@proxel.se
John Naylor <jcnaylor@gmail.com> writes:
Taking a close look at the result of setup_conversion(), wrong or at
least confusing comments are applied to the functions.
Ugh. Between that and the large chunk of initdb runtime eaten by
setup_conversion(), that seems like plenty of reason to redo it.
Solution #1 - As alluded to in [1], turn the conversions into
pg_proc.dat and pg_conversion.dat entries. Teach genbki.pl to parse
pg_wchar.h to map conversion names to numbers.
Pros:
-likely easy to do
-allows for the removal of an install target in the Makefile as well
as ad hoc logic in MSVC
-uses a format that developers need to use anyway
Cons:
-immediately burns up 88 hard-coded OIDs and one for each time a
conversion proc is created
-would require editing data in two catalogs every time a conversion
proc is created
Given the rate at which new conversion procs have been created
historically (ie, next door to zero, after the initial feature addition),
I don't think that second "con" argument has any force. Eating a batch
of manually-assigned OIDs seems risky mainly just in that it might force
adjustment of pending patches --- but we deal with that all the time.
So I like this answer, I think.
However, there is a "con" you didn't mention that perhaps ought to be
accounted for. The way things are done now, neither these C functions
nor the pg_conversion entries are "pinned"; it's possible to drop and/or
recreate them. That perhaps had significant value during development
of the conversions feature, but I'm doubtful that it's worth much
anymore. Still, it's worth pointing out in case somebody disagrees.
regards, tom lane
On 4/28/18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
John Naylor <jcnaylor@gmail.com> writes:
Solution #1 - As alluded to in [1], turn the conversions into
pg_proc.dat and pg_conversion.dat entries. Teach genbki.pl to parse
pg_wchar.h to map conversion names to numbers.
Pros:
-likely easy to do
-allows for the removal of an install target in the Makefile as well
as ad hoc logic in MSVC
-uses a format that developers need to use anyway
Cons:
-immediately burns up 88 hard-coded OIDs and one for each time a
conversion proc is created
-would require editing data in two catalogs every time a conversion
proc is createdGiven the rate at which new conversion procs have been created
historically (ie, next door to zero, after the initial feature addition),
I don't think that second "con" argument has any force. Eating a batch
of manually-assigned OIDs seems risky mainly just in that it might force
adjustment of pending patches --- but we deal with that all the time.
So I like this answer, I think.
Attached is a draft patch to do this, along with the conversion script
used to create the entries. In writing this, a few points came up that
are worth bringing up:
-In the original SQL file the functions were not declared with an
explicit volatility, so by default they are 'volatile'. That seems
wrong for this kind of function, so I changed it to 'immutable'. It
seems the CREATE CONVERSION facility was created shortly after the
volatility classes were created, and I couldn't find any discussion
about it.
-I have not done performance testing of initdb yet. I'll do so at a
later date unless someone is excited enough to beat me to it.
-I piggy-backed on the OID lookup machinery for the encoding lookup,
but haven't changed all the comments that refer only to catalogs and
OIDs.
-With the 88 pg_proc entries with prolang=13 along with the 50 or so
with prolang=14, it might be worth it to create a language lookup.
This patch does not do so, however.
-This actually uses up 220 OIDs (88 + 132), since the conversions need
them for their comments to be loaded.
However, there is a "con" you didn't mention that perhaps ought to be
accounted for. The way things are done now, neither these C functions
nor the pg_conversion entries are "pinned"; it's possible to drop and/or
recreate them. That perhaps had significant value during development
of the conversions feature, but I'm doubtful that it's worth much
anymore. Still, it's worth pointing out in case somebody disagrees.
-For this draft, I let them get pinned, and changed the sanity test to
reflect that. It'd be easy enough to add exceptions to setup_depend(),
though. (one for pg_conversion, and one to change the pg_proc query to
exclude C language functions)
I'll create a commitfest entry soon.
-John Naylor
Attachments:
v1-0001-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From 27605cd5ced2fd0a69598de93491cfb20a74836c Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Wed, 2 May 2018 17:50:53 +0700
Subject: [PATCH v1] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and pg_conversion.dat. This fixes wrong comments on the functions
and removes cruft from utils/mb/conversion_procs/Makefile,
initdb.c, and msvc/Install.pm.
Functional changes:
1. Conversions are now pinned. This can be reverted, but it's not
clear there would be any benefit in doing so.
2. The functions are now declared IMMUTABLE.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 56 +++-
src/backend/utils/mb/conversion_procs/Makefile | 177 +----------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/pg_conversion.dat | 417 +++++++++++++++++++++++++
src/include/catalog/pg_conversion.h | 42 +--
src/include/catalog/pg_proc.dat | 408 ++++++++++++++++++++++++
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 38 ---
9 files changed, 906 insertions(+), 261 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index a54197d..c987ca0 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -85,7 +85,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index fb61db0..9e12e8f 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,39 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+my $encfile = $include_path . 'mb/pg_wchar.h';
+
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ if ($collect_encodings)
+ {
+ if (/^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid++;
+ }
+ elsif (/_PG_LAST_ENCODING_/)
+ {
+ last;
+ }
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -234,12 +275,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
@@ -472,6 +517,9 @@ EOM
# postgres.shdescription
if (defined $bki_values{descr})
{
+ die "no OID associated with description \"$bki_values{descr}\""
+ if !defined $bki_values{oid};
+
if ($catalog->{shared_relation})
{
printf $shdescr "%s\t%s\t%s\n",
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467e..9669fbb 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index b39115c..58fad5c 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -253,7 +252,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1745,26 +1743,6 @@ setup_collation(FILE *cmdfd)
}
/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
-/*
* load extra dictionaries (Snowball stemmers)
*/
static void
@@ -2645,7 +2623,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2676,7 +2653,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3036,8 +3012,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000..fc5efe3
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f6..81a3013 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,33 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 66c6c22..266e05a 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -10202,4 +10202,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4400',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4401',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4402',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4403',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4404',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4405',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4406',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4407',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4408',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4409',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4410', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4411', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4412', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4413', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4414',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4415',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4416',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4417',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4418',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4419',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4420',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4421',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4422',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4423',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4424', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4425', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4426',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4427',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4428',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4429',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4430',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4431',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4432', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4433', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4434',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4435',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4436',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4437',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4438',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4439',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4440',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4441',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4442',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4443',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4444',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4445',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4446',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4447',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4448',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4449',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4450',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4451',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4452', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4453', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4454', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4455', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4456', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4457', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4458', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4459', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4460', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4461', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4462', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4463', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4464', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4465', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4466', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4467', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4468', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4469', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4470', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4471', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4472',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4473',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4474', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4475', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4476', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4477', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4478', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4479', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4480', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4481', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4482',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4483',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4484',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4485',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => '13', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4486',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => '13',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4487',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => '13',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 5aaae6c..0e523b1 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 4cc1b57..e60067e 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -137,7 +137,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -340,43 +339,6 @@ sub CopySolutionOutput
print "\n";
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
--
2.7.4
On Thu, May 3, 2018 at 12:19 AM, John Naylor <jcnaylor@gmail.com> wrote:
Attached is a draft patch to do this, along with the conversion script
used to create the entries. In writing this, a few points came up that
are worth bringing up:
Hi John,
This failed for my patch testing robot on Windows, with this message[1]https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.48:
Generating pg_config_paths.h...
No include path; you must specify -I.
Could not open src/backend/catalog/schemapg.h at
src/tools/msvc/Mkvcbuild.pm line 832.
I see that you changed src/backend/catalog/Makefile to pass the new -I
switch to genbki.pl. I think for Windows you might need to add it to
the line in src/tools/msvc/Solution.pm that invokes genbki.pl via
system()?
[1]: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.48
--
Thomas Munro
http://www.enterprisedb.com
On 5/17/18, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
Hi John,
This failed for my patch testing robot on Windows, with this message[1]:
...
I see that you changed src/backend/catalog/Makefile to pass the new -I
switch to genbki.pl. I think for Windows you might need to add it to
the line in src/tools/msvc/Solution.pm that invokes genbki.pl via
system()?
Yes, you're quite right. Thanks for the report. I've attached an
updated v2 patchset, with some additional revisions:
I wrote:
-I have not done performance testing of initdb yet. I'll do so at a
later date unless someone is excited enough to beat me to it.
Tom Lane reported [1]/messages/by-id/7408.1525812528@sss.pgh.pa.us that setup_conversion() took ~70ms out of
1300ms. With this patch, on hardware with a similar total runtime, the
total is ~65ms faster, as one would expect based on the number of new
entries.
-I piggy-backed on the OID lookup machinery for the encoding lookup,
but haven't changed all the comments that refer only to catalogs and
OIDs.
I considered changing the SGML documentation referring to OID
references [2]https://www.postgresql.org/docs/devel/static/system-catalog-initial-data.html#SYSTEM-CATALOG-OID-REFERENCES, since this patch invalidates some details, but in the
end I thought that would make the docs harder to follow for the sake
of a small corner case. Instead, I added some comments around the
encoding lookups to alert the reader we're repurposing the OID lookup
machinery. I can revisit this later if desired.
-With the 88 pg_proc entries with prolang=13 along with the 50 or so
with prolang=14, it might be worth it to create a language lookup.
This patch does not do so, however.
In version 2, patch 0001 adds a pg_language lookup. It turns out doing
so has a side benefit of simplifying Gen_fmgr.pl and its Makefile,
too.
--
[1]: /messages/by-id/7408.1525812528@sss.pgh.pa.us
[2]: https://www.postgresql.org/docs/devel/static/system-catalog-initial-data.html#SYSTEM-CATALOG-OID-REFERENCES
-John Naylor
Attachments:
v2-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v2-0001-Add-pg_language-lookup.patchDownload
From 686dd18ae238e1660ed3b2a7f6071cd5af20369d Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 18 May 2018 16:43:22 +0700
Subject: [PATCH v2 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 ++++
src/backend/utils/Gen_fmgrtab.pl | 9 ++--
src/backend/utils/Makefile | 8 +---
src/include/catalog/pg_proc.dat | 98 ++++++++++++++++++++--------------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 68 insertions(+), 67 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 5b557ff..fa96bd3 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -403,8 +403,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -414,7 +414,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index fb61db0..0440fdc 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -167,6 +167,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -241,6 +248,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index 5fd5313..0d7bd83 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I at least once.\n" if !@include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but assume the possibility of reading
+# more than one data file for historical reasons.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Determine size of the fmgr_builtins_oid_index.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', \@include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{ oid => $bki_values{oid},
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index 966e3bc..a2fd0b7 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 66c6c22..dcc11e1 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2349,7 +2349,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1177', descr => 'convert reltime to interval',
@@ -2414,16 +2414,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2586,13 +2586,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', proparallel => 'r',
@@ -2634,17 +2634,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2653,15 +2653,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2739,7 +2739,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2786,7 +2786,7 @@
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1364', descr => 'convert abstime to time',
- proname => 'time', prolang => '14', provolatile => 's', prorettype => 'time',
+ proname => 'time', prolang => 'sql', provolatile => 's', prorettype => 'time',
proargtypes => 'abstime',
prosrc => 'select cast(cast($1 as timestamp without time zone) as pg_catalog.time)' },
@@ -2828,15 +2828,15 @@
prosrc => 'textlen' },
{ oid => '1382', descr => 'extract field from abstime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text abstime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp with time zone))' },
{ oid => '1383', descr => 'extract field from reltime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text reltime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2844,7 +2844,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2959,7 +2959,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3222,7 +3222,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3484,11 +3484,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -4073,7 +4073,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4205,13 +4205,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4298,7 +4298,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4431,7 +4431,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4440,7 +4440,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4479,13 +4479,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4804,7 +4804,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5584,11 +5584,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5694,15 +5694,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5768,7 +5768,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5791,7 +5791,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -6126,11 +6126,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6931,7 +6931,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7770,21 +7770,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -8169,7 +8169,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -8182,7 +8182,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a34b259..b7ab9fc 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -40,7 +40,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 55566bf..a0967dc 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -264,16 +264,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.7.4
v2-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v2-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From a2267df5d5a0aecc17e570ed66eb3e27d54e81fa Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 18 May 2018 16:24:06 +0700
Subject: [PATCH v2 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and pg_conversion.dat. This fixes wrong comments on the functions
and removes cruft from utils/mb/conversion_procs/Makefile,
initdb.c, and msvc/Install.pm.
Functional changes:
1. Conversions are now pinned. This can be reverted, but it's not
clear there would be any benefit in doing so.
2. The functions are now declared IMMUTABLE.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 ++-
src/backend/utils/mb/conversion_procs/Makefile | 177 +----------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 +++++++++++++++++++++++++
src/include/catalog/pg_conversion.h | 47 +--
src/include/catalog/pg_proc.dat | 410 +++++++++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 38 ---
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 912 insertions(+), 264 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240..abfc798 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 0440fdc..7443256 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -241,12 +278,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467e..9669fbb 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index b39115c..58fad5c 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -253,7 +252,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1745,26 +1743,6 @@ setup_collation(FILE *cmdfd)
}
/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
-/*
* load extra dictionaries (Snowball stemmers)
*/
static void
@@ -2645,7 +2623,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2676,7 +2653,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3036,8 +3012,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index b1e2cbd..911db99 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -34,7 +34,10 @@
#define BKI_FORCE_NOT_NULL
/* Specifies a default value for a catalog field */
#define BKI_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000..fc5efe3
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f6..1782df6 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,38 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The following lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index dcc11e1..e345253 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10202,4 +10202,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 5aaae6c..0e523b1 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 4cc1b57..e60067e 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -137,7 +137,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -340,43 +339,6 @@ sub CopySolutionOutput
print "\n";
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a0967dc..8cbfaa2 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -493,7 +493,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.7.4
On Fri, May 18, 2018 at 10:53 PM, John Naylor <jcnaylor@gmail.com> wrote:
On 5/17/18, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
Hi John,
This failed for my patch testing robot on Windows, with this message[1]:
...
I see that you changed src/backend/catalog/Makefile to pass the new -I
switch to genbki.pl. I think for Windows you might need to add it to
the line in src/tools/msvc/Solution.pm that invokes genbki.pl via
system()?Yes, you're quite right. Thanks for the report. I've attached an
updated v2 patchset, with some additional revisions:
Looks good on Windows[1]https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.75 but now it's broken on Linux[2]https://travis-ci.org/postgresql-cfbot/postgresql/builds/380898356 (also
reproducible on my macOS laptop):
make[2]https://travis-ci.org/postgresql-cfbot/postgresql/builds/380898356: *** No rule to make target
`../../../src/include/pg_proc.dat', needed by `fmgr-stamp'. Stop.
[1]: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.75
[2]: https://travis-ci.org/postgresql-cfbot/postgresql/builds/380898356
--
Thomas Munro
http://www.enterprisedb.com
On 5/19/18, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
Looks good on Windows[1] but now it's broken on Linux[2] (also
reproducible on my macOS laptop):
That's what happens when I squeeze in a small Makefile change without
testing the build. Fix attached. Thanks again and sorry for the noise.
(In case I didn't mention previously, the Perl script is for
visibility; reviewers/committers don't need to run it.)
-John Naylor
Attachments:
v3-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v3-0001-Add-pg_language-lookup.patchDownload
From 686dd18ae238e1660ed3b2a7f6071cd5af20369d Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 18 May 2018 16:43:22 +0700
Subject: [PATCH v2 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 ++++
src/backend/utils/Gen_fmgrtab.pl | 9 ++--
src/backend/utils/Makefile | 8 +---
src/include/catalog/pg_proc.dat | 98 ++++++++++++++++++++--------------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 68 insertions(+), 67 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 5b557ff..fa96bd3 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -403,8 +403,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -414,7 +414,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index fb61db0..0440fdc 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -167,6 +167,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -241,6 +248,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index 5fd5313..0d7bd83 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I at least once.\n" if !@include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but assume the possibility of reading
+# more than one data file for historical reasons.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Determine size of the fmgr_builtins_oid_index.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', \@include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{ oid => $bki_values{oid},
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index 966e3bc..a2fd0b7 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 66c6c22..dcc11e1 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2349,7 +2349,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1177', descr => 'convert reltime to interval',
@@ -2414,16 +2414,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2586,13 +2586,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', proparallel => 'r',
@@ -2634,17 +2634,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2653,15 +2653,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2739,7 +2739,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2786,7 +2786,7 @@
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1364', descr => 'convert abstime to time',
- proname => 'time', prolang => '14', provolatile => 's', prorettype => 'time',
+ proname => 'time', prolang => 'sql', provolatile => 's', prorettype => 'time',
proargtypes => 'abstime',
prosrc => 'select cast(cast($1 as timestamp without time zone) as pg_catalog.time)' },
@@ -2828,15 +2828,15 @@
prosrc => 'textlen' },
{ oid => '1382', descr => 'extract field from abstime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text abstime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp with time zone))' },
{ oid => '1383', descr => 'extract field from reltime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text reltime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2844,7 +2844,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2959,7 +2959,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3222,7 +3222,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3484,11 +3484,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -4073,7 +4073,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4205,13 +4205,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4298,7 +4298,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4431,7 +4431,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4440,7 +4440,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4479,13 +4479,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4804,7 +4804,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5584,11 +5584,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5694,15 +5694,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5768,7 +5768,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5791,7 +5791,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -6126,11 +6126,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6931,7 +6931,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7770,21 +7770,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -8169,7 +8169,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -8182,7 +8182,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a34b259..b7ab9fc 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -40,7 +40,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 55566bf..a0967dc 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -264,16 +264,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.7.4
v3-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v3-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From a2267df5d5a0aecc17e570ed66eb3e27d54e81fa Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 18 May 2018 16:24:06 +0700
Subject: [PATCH v2 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and pg_conversion.dat. This fixes wrong comments on the functions
and removes cruft from utils/mb/conversion_procs/Makefile,
initdb.c, and msvc/Install.pm.
Functional changes:
1. Conversions are now pinned. This can be reverted, but it's not
clear there would be any benefit in doing so.
2. The functions are now declared IMMUTABLE.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 ++-
src/backend/utils/mb/conversion_procs/Makefile | 177 +----------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 +++++++++++++++++++++++++
src/include/catalog/pg_conversion.h | 47 +--
src/include/catalog/pg_proc.dat | 410 +++++++++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 38 ---
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 912 insertions(+), 264 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240..abfc798 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 0440fdc..7443256 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -241,12 +278,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467e..9669fbb 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index b39115c..58fad5c 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -253,7 +252,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1745,26 +1743,6 @@ setup_collation(FILE *cmdfd)
}
/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
-/*
* load extra dictionaries (Snowball stemmers)
*/
static void
@@ -2645,7 +2623,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2676,7 +2653,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3036,8 +3012,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index b1e2cbd..911db99 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -34,7 +34,10 @@
#define BKI_FORCE_NOT_NULL
/* Specifies a default value for a catalog field */
#define BKI_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000..fc5efe3
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f6..1782df6 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,38 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The following lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index dcc11e1..e345253 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10202,4 +10202,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 5aaae6c..0e523b1 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 4cc1b57..e60067e 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -137,7 +137,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -340,43 +339,6 @@ sub CopySolutionOutput
print "\n";
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a0967dc..8cbfaa2 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -493,7 +493,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.7.4
I've attached v4, which is a rebase plus some comment revisions.
-John Naylor
Attachments:
v4-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v4-0001-Add-pg_language-lookup.patchDownload
From 4d1cb1d40c5c79c732e5433e95f8560fb41e20bd Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Mon, 2 Jul 2018 12:52:07 +0700
Subject: [PATCH v4 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 ++++
src/backend/utils/Gen_fmgrtab.pl | 9 ++--
src/backend/utils/Makefile | 8 +---
src/include/catalog/pg_proc.dat | 98 ++++++++++++++++++++--------------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 68 insertions(+), 67 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index e3ba73a..ec7e617 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -405,8 +405,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -416,7 +416,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 9be51d2..8b0bcb9 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -167,6 +167,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -241,6 +248,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index fa30436..d456e0b 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but retain the possibility of reading
+# more than one data file.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Fetch a value for later.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index e797539..da40f6b 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 40d54ed..53c2332 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2349,7 +2349,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1177', descr => 'convert reltime to interval',
@@ -2414,16 +2414,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2586,13 +2586,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', proparallel => 'r',
@@ -2634,17 +2634,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2653,15 +2653,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2739,7 +2739,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2786,7 +2786,7 @@
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1364', descr => 'convert abstime to time',
- proname => 'time', prolang => '14', provolatile => 's', prorettype => 'time',
+ proname => 'time', prolang => 'sql', provolatile => 's', prorettype => 'time',
proargtypes => 'abstime',
prosrc => 'select cast(cast($1 as timestamp without time zone) as pg_catalog.time)' },
@@ -2828,15 +2828,15 @@
prosrc => 'textlen' },
{ oid => '1382', descr => 'extract field from abstime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text abstime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp with time zone))' },
{ oid => '1383', descr => 'extract field from reltime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text reltime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2844,7 +2844,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2959,7 +2959,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3222,7 +3222,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3484,11 +3484,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -4073,7 +4073,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4205,13 +4205,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4298,7 +4298,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4431,7 +4431,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4440,7 +4440,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4479,13 +4479,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4804,7 +4804,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5584,11 +5584,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5694,15 +5694,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5768,7 +5768,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5791,7 +5791,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -6126,11 +6126,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6931,7 +6931,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7770,21 +7770,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -8169,7 +8169,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -8182,7 +8182,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a34b259..b7ab9fc 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -40,7 +40,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 78db247..d6c4a85 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -269,16 +269,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.7.4
v4-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v4-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From b0e2de905fb9add6f40868a7d326b6bfe46fdf67 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Mon, 2 Jul 2018 13:10:04 +0700
Subject: [PATCH v4 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and pg_conversion.dat. This fixes wrong comments on the functions
and simplifies some build files.
Functional changes:
1. Conversions are now pinned. This can be reverted, but it's not
clear there would be any benefit in doing so.
2. The functions are now declared IMMUTABLE.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 ++-
src/backend/utils/mb/conversion_procs/Makefile | 177 +----------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 +++++++++++++++++++++++++
src/include/catalog/pg_conversion.h | 47 +--
src/include/catalog/pg_proc.dat | 410 +++++++++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 39 ---
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 912 insertions(+), 265 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240..abfc798 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 8b0bcb9..ac2db4f 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -241,12 +278,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467e..9669fbb 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index ae22e7d..2d5f977 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -253,7 +252,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1748,26 +1746,6 @@ setup_collation(FILE *cmdfd)
}
/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
-/*
* load extra dictionaries (Snowball stemmers)
*/
static void
@@ -2652,7 +2630,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2683,7 +2660,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3043,8 +3019,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index b1e2cbd..911db99 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -34,7 +34,10 @@
#define BKI_FORCE_NOT_NULL
/* Specifies a default value for a catalog field */
#define BKI_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000..fc5efe3
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f6..9d9948a 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,38 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The encoding lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 53c2332..afc9c70 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10206,4 +10206,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 5aaae6c..0e523b1 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 429608f..fc15ea4 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -139,7 +139,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -348,44 +347,6 @@ sub CopySolutionOutput
return;
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
- return;
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index d6c4a85..25b6dbf 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -498,7 +498,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.7.4
Hi John,
On Mon, Jul 02, 2018 at 01:59:03PM +0700, John Naylor wrote:
I've attached v4, which is a rebase plus some comment revisions.
v4 does not apply anymore. I am moving this patch to next commit fest,
waiting on author.
--
Michael
On 10/2/18, Michael Paquier <michael@paquier.xyz> wrote:
v4 does not apply anymore. I am moving this patch to next commit fest,
waiting on author.
v5 attached.
-John Naylor
Attachments:
v5-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v5-0001-Add-pg_language-lookup.patchDownload
From ea0a180bde325b0383ce7f0b3d48d1ce9e941393 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Mon, 2 Jul 2018 12:52:07 +0700
Subject: [PATCH v5 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +-
src/backend/catalog/genbki.pl | 8 +++
src/backend/utils/Gen_fmgrtab.pl | 9 ++-
src/backend/utils/Makefile | 8 +--
src/include/catalog/pg_proc.dat | 98 ++++++++++++++++----------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 68 insertions(+), 67 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 0fb309a1bd..176fa8bf4d 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -408,8 +408,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -419,7 +419,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 649200260a..f321662695 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -167,6 +167,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -241,6 +248,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index fa30436895..b288c5e5fd 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but retain the possibility of reading
+# more than one data file.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Fetch a value for later.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index e797539d09..da40f6b6c4 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 8e4145f42b..950abaeacf 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2349,7 +2349,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1177', descr => 'convert reltime to interval',
@@ -2414,16 +2414,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2586,13 +2586,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', proparallel => 'r',
@@ -2634,17 +2634,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2653,15 +2653,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2739,7 +2739,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2786,7 +2786,7 @@
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1364', descr => 'convert abstime to time',
- proname => 'time', prolang => '14', provolatile => 's', prorettype => 'time',
+ proname => 'time', prolang => 'sql', provolatile => 's', prorettype => 'time',
proargtypes => 'abstime',
prosrc => 'select cast(cast($1 as timestamp without time zone) as pg_catalog.time)' },
@@ -2828,15 +2828,15 @@
prosrc => 'textlen' },
{ oid => '1382', descr => 'extract field from abstime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text abstime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp with time zone))' },
{ oid => '1383', descr => 'extract field from reltime',
- proname => 'date_part', prolang => '14', provolatile => 's',
+ proname => 'date_part', prolang => 'sql', provolatile => 's',
prorettype => 'float8', proargtypes => 'text reltime',
prosrc => 'select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2844,7 +2844,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2959,7 +2959,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3222,7 +3222,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3484,11 +3484,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -4073,7 +4073,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4205,13 +4205,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4298,7 +4298,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4431,7 +4431,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4440,7 +4440,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4479,13 +4479,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4804,7 +4804,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5584,11 +5584,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5694,15 +5694,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5768,7 +5768,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5791,7 +5791,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -6126,11 +6126,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6931,7 +6931,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7770,21 +7770,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -8169,7 +8169,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -8182,7 +8182,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a34b2596fa..b7ab9fcbbf 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -40,7 +40,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 68cf812f01..bb9031a4e5 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -269,16 +269,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.17.1
v5-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v5-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From 5c6ddefdcc9b0b0a539868cac80388eea9985662 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Tue, 2 Oct 2018 13:34:13 +0700
Subject: [PATCH v5 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and the new file pg_conversion.dat. This fixes incorrect comments
on some functions, simplifies some build files, and shaves a few
tens of milliseconds off of initdb.
Functional changes:
1. Conversions are now pinned.
2. The functions are now declared IMMUTABLE.
Neither of these new behaviors are necessary for the patch, but they
make sense, and it seems the previous state of affairs was accidental.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 +-
.../utils/mb/conversion_procs/Makefile | 177 +-------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 ++++++++++++++++++
src/include/catalog/pg_conversion.h | 47 +-
src/include/catalog/pg_proc.dat | 410 ++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 39 --
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 912 insertions(+), 265 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240f11..abfc798003 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index f321662695..127205364b 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -241,12 +278,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467ea5e..9669fbb9d4 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index ab5cb7f0c1..c42e74de25 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -254,7 +253,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1773,26 +1771,6 @@ setup_collation(FILE *cmdfd)
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
}
-/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
/*
* load extra dictionaries (Snowball stemmers)
*/
@@ -2678,7 +2656,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2709,7 +2686,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3069,8 +3045,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index 8a4277b7c8..b5895ed4ae 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -36,7 +36,10 @@
#define BKI_DEFAULT(value)
/* Specifies a default value for auto-generated array types */
#define BKI_ARRAY_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000000..fc5efe3218
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f64c2..9d9948a99b 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,38 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The encoding lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 950abaeacf..2020bbc981 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10206,4 +10206,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 2d3522b500..6496cd7c16 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index c8ae1a0dc7..e2b5627633 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -139,7 +139,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -348,44 +347,6 @@ sub CopySolutionOutput
return;
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
- return;
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index bb9031a4e5..b5e8710133 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -491,7 +491,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.17.1
Attached is v6, a simple rebase.
-John Naylor
Attachments:
v6-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v6-0001-Add-pg_language-lookup.patchDownload
From e37cb80ab8e7baaa5231fc3b8dbc9d96ec253018 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Sat, 13 Oct 2018 19:28:08 +0700
Subject: [PATCH v6 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 +++
src/backend/utils/Gen_fmgrtab.pl | 9 ++--
src/backend/utils/Makefile | 8 +--
src/include/catalog/pg_proc.dat | 92 ++++++++++++++++----------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 65 insertions(+), 64 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 0fb309a1bd..176fa8bf4d 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -408,8 +408,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -419,7 +419,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 649200260a..f321662695 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -167,6 +167,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -241,6 +248,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index fa30436895..b288c5e5fd 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but retain the possibility of reading
+# more than one data file.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Fetch a value for later.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index e797539d09..da40f6b6c4 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index cff58ed2d8..980c61d880 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2210,7 +2210,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1178', descr => 'convert timestamp with time zone to date',
@@ -2263,16 +2263,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2435,13 +2435,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', prorettype => 'timestamptz',
@@ -2483,17 +2483,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2502,15 +2502,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2588,7 +2588,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2672,7 +2672,7 @@
prosrc => 'textlen' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2680,7 +2680,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2795,7 +2795,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3055,7 +3055,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3317,11 +3317,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -3906,7 +3906,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4038,13 +4038,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4131,7 +4131,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4264,7 +4264,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4273,7 +4273,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4312,13 +4312,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4637,7 +4637,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5417,11 +5417,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5521,15 +5521,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5595,7 +5595,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5618,7 +5618,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -5953,11 +5953,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6752,7 +6752,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7573,21 +7573,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -7972,7 +7972,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -7985,7 +7985,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a34b2596fa..b7ab9fcbbf 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -40,7 +40,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 68cf812f01..bb9031a4e5 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -269,16 +269,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.17.1
v6-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v6-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From 19015ed67c1b5c6e235e1464b2190b4fff905d90 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Tue, 2 Oct 2018 13:34:13 +0700
Subject: [PATCH v6 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and the new file pg_conversion.dat. This fixes incorrect comments
on some functions, simplifies some build files, and shaves a few
tens of milliseconds off of initdb.
Functional changes:
1. Conversions are now pinned.
2. The functions are now declared IMMUTABLE.
Neither of these new behaviors are necessary for the patch, but they
make sense, and it seems the previous state of affairs was accidental.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 +-
.../utils/mb/conversion_procs/Makefile | 177 +-------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 ++++++++++++++++++
src/include/catalog/pg_conversion.h | 47 +-
src/include/catalog/pg_proc.dat | 410 ++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 39 --
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 912 insertions(+), 265 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240f11..abfc798003 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index f321662695..127205364b 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -157,8 +167,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -241,12 +278,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467ea5e..9669fbb9d4 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index ab5cb7f0c1..c42e74de25 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -254,7 +253,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1773,26 +1771,6 @@ setup_collation(FILE *cmdfd)
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
}
-/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
/*
* load extra dictionaries (Snowball stemmers)
*/
@@ -2678,7 +2656,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2709,7 +2686,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3069,8 +3045,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index 8a4277b7c8..b5895ed4ae 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -36,7 +36,10 @@
#define BKI_DEFAULT(value)
/* Specifies a default value for auto-generated array types */
#define BKI_ARRAY_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000000..fc5efe3218
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 37515f64c2..9d9948a99b 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,29 +23,38 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The encoding lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 980c61d880..4dab4d27e0 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10025,4 +10025,412 @@
proisstrict => 'f', prorettype => 'bool', proargtypes => 'oid int4 int4 any',
proargmodes => '{i,i,i,v}', prosrc => 'satisfies_hash_partition' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 2d3522b500..6496cd7c16 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -71,7 +71,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 7e1c9ac848..7494bfa004 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -139,7 +139,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -348,44 +347,6 @@ sub CopySolutionOutput
return;
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
- return;
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index bb9031a4e5..b5e8710133 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -491,7 +491,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.17.1
v7 is a rebase over recent catalog changes.
-John Naylor
Attachments:
v7-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v7-0001-Add-pg_language-lookup.patchDownload
From 52aff43dcc91733c1b941fed4582d9c0602004d0 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Sat, 13 Oct 2018 19:28:08 +0700
Subject: [PATCH v7 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 +++
src/backend/utils/Gen_fmgrtab.pl | 9 ++--
src/backend/utils/Makefile | 8 +--
src/include/catalog/pg_proc.dat | 92 ++++++++++++++++----------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 65 insertions(+), 64 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 786abb95d4..37bb7a2346 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -409,8 +409,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -420,7 +420,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index edc8ea9f53..3410816882 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -175,6 +175,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -249,6 +256,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index ca28291355..87d250f318 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but retain the possibility of reading
+# more than one data file.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -78,13 +80,10 @@ foreach my $datfile (@input_files)
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
-# Fetch some values for later.
+# Fetch a value for later.
my $FirstBootstrapObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstBootstrapObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index e797539d09..da40f6b6c4 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 034a41eb55..277cee6f5e 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2210,7 +2210,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1178', descr => 'convert timestamp with time zone to date',
@@ -2263,16 +2263,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2439,13 +2439,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', prorettype => 'timestamptz',
@@ -2487,17 +2487,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2506,15 +2506,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2592,7 +2592,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2676,7 +2676,7 @@
prosrc => 'textlen' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2684,7 +2684,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2799,7 +2799,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3059,7 +3059,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3326,11 +3326,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -3915,7 +3915,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4047,13 +4047,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4140,7 +4140,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4273,7 +4273,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4282,7 +4282,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4321,13 +4321,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4646,7 +4646,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5426,11 +5426,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5530,15 +5530,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5604,7 +5604,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5627,7 +5627,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -5966,11 +5966,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6765,7 +6765,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7586,21 +7586,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -7985,7 +7985,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -7998,7 +7998,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index b25dec6c31..498afd0bdb 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -42,7 +42,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 68cf812f01..bb9031a4e5 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -269,16 +269,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.17.1
v7-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v7-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From 8a735d9c41951e123319171647f8c98daa31fd50 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Sun, 25 Nov 2018 21:43:45 +0700
Subject: [PATCH v7 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and the new file pg_conversion.dat. This fixes incorrect comments
on some functions, simplifies some build files, and shaves a few
tens of milliseconds off of initdb.
Functional changes:
1. Conversions are now pinned.
2. The functions are now declared IMMUTABLE (previously VOLATILE, the
default).
Neither of these new behaviors are necessary for the patch, but they
make sense, and it seems the previous state of affairs was accidental.
---
src/backend/catalog/Makefile | 2 +-
src/backend/catalog/genbki.pl | 49 +-
.../utils/mb/conversion_procs/Makefile | 177 +-------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 ++++++++++++++++++
src/include/catalog/pg_conversion.h | 51 ++-
src/include/catalog/pg_proc.dat | 410 ++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 39 --
src/tools/msvc/Solution.pm | 4 +-
11 files changed, 915 insertions(+), 266 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 0865240f11..abfc798003 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -88,7 +88,7 @@ generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp
# instead is cheating a bit, but it will achieve the goal of updating the
# version number when it changes.
bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in
- $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
touch $@
# The generated headers must all be symlinked into builddir/src/include/,
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 3410816882..b4b7cdaf50 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -20,6 +20,7 @@ use strict;
use warnings;
my @input_files;
+my $include_path;
my $output_path = '';
my $major_version;
@@ -35,6 +36,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -49,13 +54,18 @@ while (@ARGV)
# Sanity check arguments.
die "No input files.\n" if !@input_files;
+die "No include path; you must specify -I.\n" if !$include_path;
die "--set-version must be specified.\n" if !defined $major_version;
-# Make sure output_path ends in a slash.
+# Make sure paths end in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -165,8 +175,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -249,12 +286,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467ea5e..9669fbb9d4 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 211a96380e..e378a9a095 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -254,7 +253,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1774,26 +1772,6 @@ setup_collation(FILE *cmdfd)
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
}
-/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
/*
* load extra dictionaries (Snowball stemmers)
*/
@@ -2679,7 +2657,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2710,7 +2687,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3070,8 +3046,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index c6a7feac24..1ace1d36a7 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -35,7 +35,10 @@
#define BKI_DEFAULT(value)
/* Specifies a default value for auto-generated array types */
#define BKI_ARRAY_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000000..fc5efe3218
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 6e8f054306..9f31d41272 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,30 +23,41 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
- Oid oid; /* oid */
+ /* oid */
+ Oid oid;
+
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The encoding lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 277cee6f5e..895071ead2 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10048,4 +10048,412 @@
proargnames => '{rootrelid,relid,parentrelid,isleaf,level}',
prosrc => 'pg_partition_tree' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 1d4b000acf..8538173ff8 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -74,7 +74,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 7e1c9ac848..7494bfa004 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -139,7 +139,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -348,44 +347,6 @@ sub CopySolutionOutput
return;
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
- return;
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index bb9031a4e5..b5e8710133 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -491,7 +491,9 @@ EOF
{
chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
- system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
+ system(
+"perl genbki.pl -I ../../../src/include/ --set-version=$self->{majorver} $bki_srcs"
+ );
open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
--
2.17.1
On Mon, Nov 26, 2018 at 9:31 AM John Naylor <jcnaylor@gmail.com> wrote:
v7 is a rebase over recent catalog changes.
Thanks for working on this,
I see that the author keeps patch updated, but I'm a bit worried because of
lack of full review since probably May. I'm moving it to the next CF, let's see
if there would be more feedback.
P.S. adding Daniel, since he is assigned as a reviewer.
On 12/1/18, Dmitry Dolgov <9erthalion6@gmail.com> wrote:
I see that the author keeps patch updated, but I'm a bit worried because of
lack of full review since probably May. I'm moving it to the next CF, let's
see
if there would be more feedback.P.S. adding Daniel, since he is assigned as a reviewer.
Having heard nothing in a while, I've removed Daniel as a reviewer to
make room for someone else. He is, of course free to re-add himself.
v8 is attached.
Since it's been a few months since last discussion, I'd like to
summarize the purpose of this patch and advocate for its inclusion in
v12:
1. Correctness
In the intro thread [1]/messages/by-id/CAJVSVGWtUqxpfAaxS88vEGvi+jKzWZb2EStu5io-UPc4p9rSJg@mail.gmail.com, I showed that object comments on some
conversions are wrong, and hard to fix given the current setup. This
is a documentation bug of sorts.
2. Clean-up
Currently, utils/mb/conversion_procs/Makefile has an ad-hoc script to
generate the SQL file, which has to be duplicated in the MSVC tooling,
and executed by initdb.c. Storing the conversions in .dat files
removes the need for any of that.
3. Performance
This patch shaves 5-6% off of initdb. Not as much as hoped, but still
a nice bonus.
[1]: /messages/by-id/CAJVSVGWtUqxpfAaxS88vEGvi+jKzWZb2EStu5io-UPc4p9rSJg@mail.gmail.com
--John Naylor
Attachments:
v8-0001-Add-pg_language-lookup.patchtext/x-patch; charset=US-ASCII; name=v8-0001-Add-pg_language-lookup.patchDownload
From bdbdb36129708d1d417f8db9009b377c3d4e3e90 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 14 Dec 2018 15:19:54 -0500
Subject: [PATCH v8 1/2] Add pg_language lookup.
This didn't seem worth doing before, but an upcoming commit will add
88 entries to pg_proc whose languge is 'c'. In addition, we can
now use 'internal' in Gen_fmgr.pl instead of looking up the OID.
This simplifies that script and its Makefile a bit.
---
doc/src/sgml/bki.sgml | 6 +--
src/backend/catalog/genbki.pl | 8 +++
src/backend/utils/Gen_fmgrtab.pl | 7 ++-
src/backend/utils/Makefile | 8 +--
src/include/catalog/pg_proc.dat | 92 ++++++++++++++++----------------
src/include/catalog/pg_proc.h | 2 +-
src/tools/msvc/Solution.pm | 4 +-
7 files changed, 64 insertions(+), 63 deletions(-)
diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml
index 786abb95d4..37bb7a2346 100644
--- a/doc/src/sgml/bki.sgml
+++ b/doc/src/sgml/bki.sgml
@@ -409,8 +409,8 @@
that's error-prone and hard to understand, so for frequently-referenced
catalogs, <filename>genbki.pl</filename> provides mechanisms to write
symbolic references instead. Currently this is possible for references
- to access methods, functions, operators, opclasses, opfamilies, and
- types. The rules are as follows:
+ to access methods, functions, languages, operators, opclasses, opfamilies,
+ and types. The rules are as follows:
</para>
<itemizedlist>
@@ -420,7 +420,7 @@
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
- is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+ is <literal>pg_am</literal>, <literal>pg_proc</literal>, <literal>pg_language</literal>,
<literal>pg_operator</literal>, <literal>pg_opclass</literal>,
<literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 8e2a2480be..8ccfcb7724 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -182,6 +182,13 @@ foreach my $row (@{ $catalog_data{pg_am} })
$amoids{ $row->{amname} } = $row->{oid};
}
+# language OID lookup
+my %langoids;
+foreach my $row (@{ $catalog_data{pg_language} })
+{
+ $langoids{ $row->{lanname} } = $row->{oid};
+}
+
# opclass OID lookup
my %opcoids;
foreach my $row (@{ $catalog_data{pg_opclass} })
@@ -256,6 +263,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
# Map catalog name to OID lookup.
my %lookup_kind = (
pg_am => \%amoids,
+ pg_language => \%langoids,
pg_opclass => \%opcoids,
pg_operator => \%operoids,
pg_opfamily => \%opfoids,
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index ed16737a6a..b6809c7277 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path;
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
+# We currently only need pg_proc, but retain the possibility of reading
+# more than one data file.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
@@ -82,9 +84,6 @@ foreach my $datfile (@input_files)
my $FirstGenbkiObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstGenbkiObjectId');
-my $INTERNALlanguageId =
- Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
- 'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
@@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} })
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
- next if $bki_values{prolang} ne $INTERNALlanguageId;
+ next if $bki_values{prolang} ne 'internal';
push @fmgr,
{
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index e797539d09..da40f6b6c4 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_
$(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h
-FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\
- pg_language.dat pg_proc.dat \
- )
-
# fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
# the timestamps of the individual output files, because the Perl script
# won't update them if they didn't change (to avoid unnecessary recompiles).
-fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h
- $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA)
+fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h
+ $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat
touch $@
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index f79fcfe029..c8c27948f0 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -2210,7 +2210,7 @@
proname => 'justify_days', prorettype => 'interval',
proargtypes => 'interval', prosrc => 'interval_justify_days' },
{ oid => '1176', descr => 'convert date and time to timestamp with time zone',
- proname => 'timestamptz', prolang => '14', provolatile => 's',
+ proname => 'timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'date time',
prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
{ oid => '1178', descr => 'convert timestamp with time zone to date',
@@ -2263,16 +2263,16 @@
prosrc => 'interval_scale' },
{ oid => '1215', descr => 'get description for object id and catalog name',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' },
{ oid => '1216', descr => 'get description for table column',
- proname => 'col_description', prolang => '14', procost => '100',
+ proname => 'col_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid int4',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' },
{ oid => '1993',
descr => 'get description for object id and shared catalog name',
- proname => 'shobj_description', prolang => '14', procost => '100',
+ proname => 'shobj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid name',
prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' },
@@ -2439,13 +2439,13 @@
prosrc => 'tidsmaller' },
{ oid => '1296',
- proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp',
+ proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'time date', prosrc => 'select ($2 + $1)' },
{ oid => '1297',
proname => 'datetimetz_pl', prorettype => 'timestamptz',
proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
{ oid => '1298',
- proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz',
+ proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' },
{ oid => '1299', descr => 'current transaction time',
proname => 'now', provolatile => 's', prorettype => 'timestamptz',
@@ -2487,17 +2487,17 @@
proargtypes => 'timestamptz timestamptz timestamptz timestamptz',
prosrc => 'overlaps_timestamp' },
{ oid => '1305', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1306', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz timestamptz timestamptz interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1307', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'bool',
proargtypes => 'timestamptz interval timestamptz timestamptz',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2506,15 +2506,15 @@
proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
proargtypes => 'time time time time', prosrc => 'overlaps_time' },
{ oid => '1309', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '1310', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time time time interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '1311', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'time interval time time',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
@@ -2592,7 +2592,7 @@
# This form of obj_description is now deprecated, since it will fail if
# OIDs are not unique across system catalogs. Use the other form instead.
{ oid => '1348', descr => 'deprecated, use two-argument form instead',
- proname => 'obj_description', prolang => '14', procost => '100',
+ proname => 'obj_description', prolang => 'sql', procost => '100',
provolatile => 's', prorettype => 'text', proargtypes => 'oid',
prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' },
@@ -2676,7 +2676,7 @@
prosrc => 'textlen' },
{ oid => '1384', descr => 'extract field from date',
- proname => 'date_part', prolang => '14', prorettype => 'float8',
+ proname => 'date_part', prolang => 'sql', prorettype => 'float8',
proargtypes => 'text date',
prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' },
{ oid => '1385', descr => 'extract field from time',
@@ -2684,7 +2684,7 @@
prosrc => 'time_part' },
{ oid => '1386',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' },
@@ -2799,7 +2799,7 @@
proname => 'box_div', prorettype => 'box', proargtypes => 'box point',
prosrc => 'box_div' },
{ oid => '1426',
- proname => 'path_contain_pt', prolang => '14', prorettype => 'bool',
+ proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool',
proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' },
{ oid => '1428',
proname => 'poly_contain_pt', prorettype => 'bool',
@@ -3059,7 +3059,7 @@
proname => 'center', prorettype => 'point', proargtypes => 'circle',
prosrc => 'circle_center' },
{ oid => '1544', descr => 'convert circle to 12-vertex polygon',
- proname => 'polygon', prolang => '14', prorettype => 'polygon',
+ proname => 'polygon', prolang => 'sql', prorettype => 'polygon',
proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' },
{ oid => '1545', descr => 'number of points',
proname => 'npoints', prorettype => 'int4', proargtypes => 'path',
@@ -3326,11 +3326,11 @@
proname => 'translate', prorettype => 'text', proargtypes => 'text text text',
prosrc => 'translate' },
{ oid => '879', descr => 'left-pad string to length',
- proname => 'lpad', prolang => '14', prorettype => 'text',
+ proname => 'lpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.lpad($1, $2, \' \')' },
{ oid => '880', descr => 'right-pad string to length',
- proname => 'rpad', prolang => '14', prorettype => 'text',
+ proname => 'rpad', prolang => 'sql', prorettype => 'text',
proargtypes => 'text int4',
prosrc => 'select pg_catalog.rpad($1, $2, \' \')' },
{ oid => '881', descr => 'trim spaces from left end of string',
@@ -3915,7 +3915,7 @@
proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
prosrc => 'inetpl' },
{ oid => '2631',
- proname => 'int8pl_inet', prolang => '14', prorettype => 'inet',
+ proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
proargtypes => 'int8 inet', prosrc => 'select $2 + $1' },
{ oid => '2632',
proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
@@ -4047,13 +4047,13 @@
proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_round' },
{ oid => '1708', descr => 'value rounded to \'scale\' of zero',
- proname => 'round', prolang => '14', prorettype => 'numeric',
+ proname => 'round', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' },
{ oid => '1709', descr => 'value truncated to \'scale\'',
proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
prosrc => 'numeric_trunc' },
{ oid => '1710', descr => 'value truncated to \'scale\' of zero',
- proname => 'trunc', prolang => '14', prorettype => 'numeric',
+ proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' },
{ oid => '1711', descr => 'nearest integer >= value',
proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
@@ -4140,7 +4140,7 @@
proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4',
prosrc => 'int4_numeric' },
{ oid => '1741', descr => 'base 10 logarithm',
- proname => 'log', prolang => '14', prorettype => 'numeric',
+ proname => 'log', prolang => 'sql', prorettype => 'numeric',
proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' },
{ oid => '1742', descr => 'convert float4 to numeric',
proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4',
@@ -4273,7 +4273,7 @@
proname => 'quote_literal', prorettype => 'text', proargtypes => 'text',
prosrc => 'quote_literal' },
{ oid => '1285', descr => 'quote a data value for usage in a querystring',
- proname => 'quote_literal', prolang => '14', provolatile => 's',
+ proname => 'quote_literal', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' },
{ oid => '1289',
@@ -4282,7 +4282,7 @@
proargtypes => 'text', prosrc => 'quote_nullable' },
{ oid => '1290',
descr => 'quote a possibly-null data value for usage in a querystring',
- proname => 'quote_nullable', prolang => '14', proisstrict => 'f',
+ proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f',
provolatile => 's', prorettype => 'text', proargtypes => 'anyelement',
prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' },
@@ -4321,13 +4321,13 @@
prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' },
{ oid => '1810', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1811', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' },
{ oid => '1812', descr => 'length in bits',
- proname => 'bit_length', prolang => '14', prorettype => 'int4',
+ proname => 'bit_length', prolang => 'sql', prorettype => 'int4',
proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' },
# Selectivity estimators for LIKE and related operators
@@ -4646,7 +4646,7 @@
prosrc => 'to_ascii_encname' },
{ oid => '1848',
- proname => 'interval_pl_time', prolang => '14', prorettype => 'time',
+ proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time',
proargtypes => 'interval time', prosrc => 'select $2 + $1' },
{ oid => '1850',
@@ -5426,11 +5426,11 @@
proargtypes => 'timetz int4', prosrc => 'timetz_scale' },
{ oid => '2003',
- proname => 'textanycat', prolang => '14', provolatile => 's',
+ proname => 'textanycat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'text anynonarray',
prosrc => 'select $1 || $2::pg_catalog.text' },
{ oid => '2004',
- proname => 'anytextcat', prolang => '14', provolatile => 's',
+ proname => 'anytextcat', prolang => 'sql', provolatile => 's',
prorettype => 'text', proargtypes => 'anynonarray text',
prosrc => 'select $1::pg_catalog.text || $2' },
@@ -5530,15 +5530,15 @@
proargtypes => 'timestamp timestamp timestamp timestamp',
prosrc => 'overlaps_timestamp' },
{ oid => '2042', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' },
{ oid => '2043', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval',
prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' },
{ oid => '2044', descr => 'intervals overlap?',
- proname => 'overlaps', prolang => '14', proisstrict => 'f',
+ proname => 'overlaps', prolang => 'sql', proisstrict => 'f',
prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp',
prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' },
{ oid => '2045', descr => 'less-equal-greater',
@@ -5604,7 +5604,7 @@
proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' },
{ oid => '2059',
descr => 'date difference from today preserving months and years',
- proname => 'age', prolang => '14', provolatile => 's',
+ proname => 'age', prolang => 'sql', provolatile => 's',
prorettype => 'interval', proargtypes => 'timestamp',
prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' },
@@ -5627,7 +5627,7 @@
proname => 'substring', prorettype => 'text', proargtypes => 'text text',
prosrc => 'textregexsubstr' },
{ oid => '2074', descr => 'extract text matching SQL99 regular expression',
- proname => 'substring', prolang => '14', prorettype => 'text',
+ proname => 'substring', prolang => 'sql', prorettype => 'text',
proargtypes => 'text text text',
prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' },
@@ -5966,11 +5966,11 @@
proname => 'pg_sleep', provolatile => 'v', prorettype => 'void',
proargtypes => 'float8', prosrc => 'pg_sleep' },
{ oid => '3935', descr => 'sleep for the specified interval',
- proname => 'pg_sleep_for', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'interval',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '3936', descr => 'sleep until the specified time',
- proname => 'pg_sleep_until', prolang => '14', provolatile => 'v',
+ proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v',
prorettype => 'void', proargtypes => 'timestamptz',
prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' },
{ oid => '315', descr => 'Is JIT compilation available in this session?',
@@ -6765,7 +6765,7 @@
proargtypes => 'name', prosrc => 'pg_database_size_name' },
{ oid => '2325',
descr => 'disk space usage for the main fork of the specified table or index',
- proname => 'pg_relation_size', prolang => '14', provolatile => 'v',
+ proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v',
prorettype => 'int8', proargtypes => 'regclass',
prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' },
{ oid => '2332',
@@ -7586,21 +7586,21 @@
# formerly-missing interval + datetime operators
{ oid => '2546',
- proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp',
+ proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
proargtypes => 'interval date', prosrc => 'select $2 + $1' },
{ oid => '2547',
- proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz',
+ proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
proargtypes => 'interval timetz', prosrc => 'select $2 + $1' },
{ oid => '2548',
- proname => 'interval_pl_timestamp', prolang => '14',
+ proname => 'interval_pl_timestamp', prolang => 'sql',
prorettype => 'timestamp', proargtypes => 'interval timestamp',
prosrc => 'select $2 + $1' },
{ oid => '2549',
- proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's',
+ proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
prosrc => 'select $2 + $1' },
{ oid => '2550',
- proname => 'integer_pl_date', prolang => '14', prorettype => 'date',
+ proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
proargtypes => 'int4 date', prosrc => 'select $2 + $1' },
{ oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -7985,7 +7985,7 @@
proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text',
prosrc => 'xpath' },
{ oid => '2932', descr => 'evaluate XPath expression',
- proname => 'xpath', prolang => '14', prorettype => '_xml',
+ proname => 'xpath', prolang => 'sql', prorettype => '_xml',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' },
@@ -7998,7 +7998,7 @@
proname => 'xpath_exists', prorettype => 'bool',
proargtypes => 'text xml _text', prosrc => 'xpath_exists' },
{ oid => '3050', descr => 'test XML value against XPath expression',
- proname => 'xpath_exists', prolang => '14', prorettype => 'bool',
+ proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool',
proargtypes => 'text xml',
prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' },
{ oid => '3051', descr => 'determine if a string is well formed XML',
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index b25dec6c31..498afd0bdb 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -42,7 +42,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce
Oid proowner BKI_DEFAULT(PGUID);
/* OID of pg_language entry */
- Oid prolang BKI_DEFAULT(12);
+ Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language);
/* estimated execution cost */
float4 procost BKI_DEFAULT(1);
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 0b7cdf8dd5..eb2346b8d3 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -269,16 +269,14 @@ sub GenerateFiles
"LIBPGTYPES");
chdir('src/backend/utils');
- my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
- || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{
system(
- "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
+ "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat"
);
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
--
2.17.1
v8-0002-Replace-ad-hoc-format-for-conversion-functions.patchtext/x-patch; charset=US-ASCII; name=v8-0002-Replace-ad-hoc-format-for-conversion-functions.patchDownload
From d8654e82da8012761c67ae8b04ad3c1c079f4a71 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Fri, 14 Dec 2018 15:44:10 -0500
Subject: [PATCH v8 2/2] Replace ad hoc format for conversion functions
Convert info for conversion functions into entries in pg_proc.dat
and the new file pg_conversion.dat. This fixes incorrect comments
on some functions, simplifies some build files, and shaves a few
tens of milliseconds off of initdb.
Functional changes:
1. Conversions are now pinned.
2. The functions are now declared IMMUTABLE (previously VOLATILE, the
default).
Neither of these new behaviors are necessary for the patch, but they
make sense, and it seems the previous state of affairs was accidental.
---
src/backend/catalog/genbki.pl | 47 +-
.../utils/mb/conversion_procs/Makefile | 177 +-------
src/bin/initdb/initdb.c | 26 --
src/include/catalog/genbki.h | 5 +-
src/include/catalog/pg_conversion.dat | 417 ++++++++++++++++++
src/include/catalog/pg_conversion.h | 51 ++-
src/include/catalog/pg_proc.dat | 410 ++++++++++++++++-
src/test/regress/expected/misc_sanity.out | 1 -
src/tools/msvc/Install.pm | 39 --
9 files changed, 909 insertions(+), 264 deletions(-)
create mode 100644 src/include/catalog/pg_conversion.dat
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 8ccfcb7724..c42c1563aa 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -40,6 +40,10 @@ while (@ARGV)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
+ elsif ($arg =~ /^-I/)
+ {
+ $include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
@@ -57,11 +61,15 @@ die "No input files.\n" if !@input_files;
die "--set-version must be specified.\n" if !defined $major_version;
die "-I, the header include path, must be specified.\n" if !$include_path;
-# Make sure output_path ends in a slash.
+# Make sure paths ends in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
+if (substr($include_path, -1) ne '/')
+{
+ $include_path .= '/';
+}
# Read all the files into internal data structures.
my @catnames;
@@ -172,8 +180,35 @@ my $PG_CATALOG_NAMESPACE =
'PG_CATALOG_NAMESPACE');
-# Build lookup tables for OID macro substitutions and for pg_attribute
-# copies of pg_type values.
+# Build lookup tables.
+
+# Encoding identifier lookup. This uses the same machinery as for OIDs.
+my %encids;
+my $collect_encodings = 0;
+
+my $encfile = $include_path . 'mb/pg_wchar.h';
+open(my $ef, '<', $encfile) || die "$encfile: $!";
+
+# We're parsing an enum, so start with 0 and increment
+# every time we find an enum member.
+my $encid = 0;
+while (<$ef>)
+{
+ if (/typedef\s+enum\s+pg_enc/)
+ {
+ $collect_encodings = 1;
+ next;
+ }
+
+ last if /_PG_LAST_ENCODING_/;
+
+ if ($collect_encodings and /^\s+(PG_\w+)/)
+ {
+ $encids{$1} = $encid;
+ $encid++;
+ }
+}
+close $ef;
# index access method OID lookup
my %amoids;
@@ -256,12 +291,16 @@ my %typeoids;
my %types;
foreach my $row (@{ $catalog_data{pg_type} })
{
+ # for OID macro substitutions
$typeoids{ $row->{typname} } = $row->{oid};
+
+ # for pg_attribute copies of pg_type values
$types{ $row->{typname} } = $row;
}
-# Map catalog name to OID lookup.
+# Map lookup name to the corresponding hash table.
my %lookup_kind = (
+ encoding => \%encids,
pg_am => \%amoids,
pg_language => \%langoids,
pg_opclass => \%opcoids,
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index 879467ea5e..9669fbb9d4 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -1,10 +1,11 @@
#-------------------------------------------------------------------------
#
-# Makefile--
-# Makefile for utils/mb/conversion_procs
+# Makefile for utils/mb/conversion_procs
#
-# IDENTIFICATION
-# src/backend/utils/mb/conversion_procs/Makefile
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/backend/utils/mb/conversion_procs/Makefile
#
#-------------------------------------------------------------------------
@@ -12,8 +13,6 @@ subdir = src/backend/utils/mb/conversion_procs
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global
-SQLSCRIPT = conversion_create.sql
-
SUBDIRS = \
ascii_and_mic cyrillic_and_mic euc_cn_and_mic euc_jp_and_sjis \
euc_kr_and_mic euc_tw_and_big5 latin2_and_win1250 latin_and_mic \
@@ -25,170 +24,4 @@ SUBDIRS = \
$(recurse)
-# conversion_name source_encoding destination_encoding function object
-CONVERSIONS = \
- ascii_to_mic SQL_ASCII MULE_INTERNAL ascii_to_mic ascii_and_mic \
- mic_to_ascii MULE_INTERNAL SQL_ASCII mic_to_ascii ascii_and_mic \
- koi8_r_to_mic KOI8R MULE_INTERNAL koi8r_to_mic cyrillic_and_mic \
- mic_to_koi8_r MULE_INTERNAL KOI8R mic_to_koi8r cyrillic_and_mic \
- iso_8859_5_to_mic ISO-8859-5 MULE_INTERNAL iso_to_mic cyrillic_and_mic \
- mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \
- windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \
- mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \
- windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \
- mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \
- koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \
- windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \
- koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \
- windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \
- windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \
- windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \
- iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \
- koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \
- windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \
- iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \
- windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \
- euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \
- mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \
- euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \
- sjis_to_euc_jp SJIS EUC_JP sjis_to_euc_jp euc_jp_and_sjis \
- euc_jp_to_mic EUC_JP MULE_INTERNAL euc_jp_to_mic euc_jp_and_sjis \
- sjis_to_mic SJIS MULE_INTERNAL sjis_to_mic euc_jp_and_sjis \
- mic_to_euc_jp MULE_INTERNAL EUC_JP mic_to_euc_jp euc_jp_and_sjis \
- mic_to_sjis MULE_INTERNAL SJIS mic_to_sjis euc_jp_and_sjis \
- euc_kr_to_mic EUC_KR MULE_INTERNAL euc_kr_to_mic euc_kr_and_mic \
- mic_to_euc_kr MULE_INTERNAL EUC_KR mic_to_euc_kr euc_kr_and_mic \
- euc_tw_to_big5 EUC_TW BIG5 euc_tw_to_big5 euc_tw_and_big5 \
- big5_to_euc_tw BIG5 EUC_TW big5_to_euc_tw euc_tw_and_big5 \
- euc_tw_to_mic EUC_TW MULE_INTERNAL euc_tw_to_mic euc_tw_and_big5 \
- big5_to_mic BIG5 MULE_INTERNAL big5_to_mic euc_tw_and_big5 \
- mic_to_euc_tw MULE_INTERNAL EUC_TW mic_to_euc_tw euc_tw_and_big5 \
- mic_to_big5 MULE_INTERNAL BIG5 mic_to_big5 euc_tw_and_big5 \
- iso_8859_2_to_mic LATIN2 MULE_INTERNAL latin2_to_mic latin2_and_win1250 \
- mic_to_iso_8859_2 MULE_INTERNAL LATIN2 mic_to_latin2 latin2_and_win1250 \
- windows_1250_to_mic WIN1250 MULE_INTERNAL win1250_to_mic latin2_and_win1250 \
- mic_to_windows_1250 MULE_INTERNAL WIN1250 mic_to_win1250 latin2_and_win1250 \
- iso_8859_2_to_windows_1250 LATIN2 WIN1250 latin2_to_win1250 latin2_and_win1250 \
- windows_1250_to_iso_8859_2 WIN1250 LATIN2 win1250_to_latin2 latin2_and_win1250 \
- iso_8859_1_to_mic LATIN1 MULE_INTERNAL latin1_to_mic latin_and_mic \
- mic_to_iso_8859_1 MULE_INTERNAL LATIN1 mic_to_latin1 latin_and_mic \
- iso_8859_3_to_mic LATIN3 MULE_INTERNAL latin3_to_mic latin_and_mic \
- mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \
- iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \
- mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \
- ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \
- utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \
- big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \
- utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \
- utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \
- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \
- utf8_to_koi8_u UTF8 KOI8U utf8_to_koi8u utf8_and_cyrillic \
- koi8_u_to_utf8 KOI8U UTF8 koi8u_to_utf8 utf8_and_cyrillic \
- utf8_to_windows_866 UTF8 WIN866 utf8_to_win utf8_and_win \
- windows_866_to_utf8 WIN866 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_874 UTF8 WIN874 utf8_to_win utf8_and_win \
- windows_874_to_utf8 WIN874 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win utf8_and_win \
- windows_1250_to_utf8 WIN1250 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win utf8_and_win \
- windows_1251_to_utf8 WIN1251 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win utf8_and_win \
- windows_1252_to_utf8 WIN1252 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1253 UTF8 WIN1253 utf8_to_win utf8_and_win \
- windows_1253_to_utf8 WIN1253 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1254 UTF8 WIN1254 utf8_to_win utf8_and_win \
- windows_1254_to_utf8 WIN1254 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1255 UTF8 WIN1255 utf8_to_win utf8_and_win \
- windows_1255_to_utf8 WIN1255 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win utf8_and_win \
- windows_1256_to_utf8 WIN1256 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1257 UTF8 WIN1257 utf8_to_win utf8_and_win \
- windows_1257_to_utf8 WIN1257 UTF8 win_to_utf8 utf8_and_win \
- utf8_to_windows_1258 UTF8 WIN1258 utf8_to_win utf8_and_win \
- windows_1258_to_utf8 WIN1258 UTF8 win_to_utf8 utf8_and_win \
- euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \
- utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \
- euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \
- utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \
- euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \
- utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \
- euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \
- utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \
- gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \
- utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \
- gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \
- utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \
- utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \
- iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \
- iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \
- utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \
- johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \
- utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \
- sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \
- utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \
- uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \
- utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \
- euc_jis_2004_to_utf8 EUC_JIS_2004 UTF8 euc_jis_2004_to_utf8 utf8_and_euc2004 \
- utf8_to_euc_jis_2004 UTF8 EUC_JIS_2004 utf8_to_euc_jis_2004 utf8_and_euc2004 \
- shift_jis_2004_to_utf8 SHIFT_JIS_2004 UTF8 shift_jis_2004_to_utf8 utf8_and_sjis2004 \
- utf8_to_shift_jis_2004 UTF8 SHIFT_JIS_2004 utf8_to_shift_jis_2004 utf8_and_sjis2004 \
- euc_jis_2004_to_shift_jis_2004 EUC_JIS_2004 SHIFT_JIS_2004 euc_jis_2004_to_shift_jis_2004 euc2004_sjis2004 \
- shift_jis_2004_to_euc_jis_2004 SHIFT_JIS_2004 EUC_JIS_2004 shift_jis_2004_to_euc_jis_2004 euc2004_sjis2004
-
-all: $(SQLSCRIPT)
-
-$(SQLSCRIPT): Makefile
- @set -e; \
- set $(CONVERSIONS) ; \
- while [ "$$#" -gt 0 ] ; \
- do \
- name=$$1;shift; \
- se=$$1;shift; \
- de=$$1; shift; \
- func=$$1; shift; \
- obj=$$1; shift; \
- echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
- echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
- echo "DROP CONVERSION pg_catalog.$$name;"; \
- echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
- echo "COMMENT ON CONVERSION pg_catalog.$$name IS 'conversion for $$se to $$de';"; \
- echo; \
- done > $@
-
-install: $(SQLSCRIPT) installdirs
- $(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(datadir)' '$(DESTDIR)$(pkglibdir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
-clean distclean maintainer-clean:
- rm -f $(SQLSCRIPT)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 211a96380e..e378a9a095 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -155,7 +155,6 @@ static char *shdesc_file;
static char *hba_file;
static char *ident_file;
static char *conf_file;
-static char *conversion_file;
static char *dictionary_file;
static char *info_schema_file;
static char *features_file;
@@ -254,7 +253,6 @@ static void setup_depend(FILE *cmdfd);
static void setup_sysviews(FILE *cmdfd);
static void setup_description(FILE *cmdfd);
static void setup_collation(FILE *cmdfd);
-static void setup_conversion(FILE *cmdfd);
static void setup_dictionary(FILE *cmdfd);
static void setup_privileges(FILE *cmdfd);
static void set_info_version(void);
@@ -1774,26 +1772,6 @@ setup_collation(FILE *cmdfd)
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
}
-/*
- * load conversion functions
- */
-static void
-setup_conversion(FILE *cmdfd)
-{
- char **line;
- char **conv_lines;
-
- conv_lines = readfile(conversion_file);
- for (line = conv_lines; *line != NULL; line++)
- {
- if (strstr(*line, "DROP CONVERSION") != *line)
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(conv_lines);
-}
-
/*
* load extra dictionaries (Snowball stemmers)
*/
@@ -2679,7 +2657,6 @@ setup_data_file_paths(void)
set_input(&hba_file, "pg_hba.conf.sample");
set_input(&ident_file, "pg_ident.conf.sample");
set_input(&conf_file, "postgresql.conf.sample");
- set_input(&conversion_file, "conversion_create.sql");
set_input(&dictionary_file, "snowball_create.sql");
set_input(&info_schema_file, "information_schema.sql");
set_input(&features_file, "sql_features.txt");
@@ -2710,7 +2687,6 @@ setup_data_file_paths(void)
check_input(hba_file);
check_input(ident_file);
check_input(conf_file);
- check_input(conversion_file);
check_input(dictionary_file);
check_input(info_schema_file);
check_input(features_file);
@@ -3070,8 +3046,6 @@ initialize_data_directory(void)
setup_collation(cmdfd);
- setup_conversion(cmdfd);
-
setup_dictionary(cmdfd);
setup_privileges(cmdfd);
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index c6a7feac24..1ace1d36a7 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -35,7 +35,10 @@
#define BKI_DEFAULT(value)
/* Specifies a default value for auto-generated array types */
#define BKI_ARRAY_DEFAULT(value)
-/* Indicates how to perform name lookups for an OID or OID-array field */
+/*
+ * Indicates how to perform name lookups, typically for an OID or
+ * OID-array field
+ */
#define BKI_LOOKUP(catalog)
/* The following are never defined; they are here only for documentation. */
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
new file mode 100644
index 0000000000..fc5efe3218
--- /dev/null
+++ b/src/include/catalog/pg_conversion.dat
@@ -0,0 +1,417 @@
+#----------------------------------------------------------------------
+#
+# pg_conversion.dat
+# Initial contents of the pg_conversion system catalog.
+#
+# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/include/catalog/pg_conversion.dat
+#
+#----------------------------------------------------------------------
+
+# Note: conforencoding and contoencoding must match the spelling of
+# the labels used in the enum pg_enc in mb/pg_wchar.h.
+
+[
+
+{ oid => '4800', descr => 'conversion for SQL_ASCII to MULE_INTERNAL',
+ conname => 'ascii_to_mic', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'ascii_to_mic' },
+{ oid => '4801', descr => 'conversion for MULE_INTERNAL to SQL_ASCII',
+ conname => 'mic_to_ascii', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'mic_to_ascii' },
+{ oid => '4802', descr => 'conversion for KOI8R to MULE_INTERNAL',
+ conname => 'koi8_r_to_mic', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'koi8r_to_mic' },
+{ oid => '4803', descr => 'conversion for MULE_INTERNAL to KOI8R',
+ conname => 'mic_to_koi8_r', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_KOI8R', conproc => 'mic_to_koi8r' },
+{ oid => '4804', descr => 'conversion for ISO-8859-5 to MULE_INTERNAL',
+ conname => 'iso_8859_5_to_mic', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'iso_to_mic' },
+{ oid => '4805', descr => 'conversion for MULE_INTERNAL to ISO-8859-5',
+ conname => 'mic_to_iso_8859_5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'mic_to_iso' },
+{ oid => '4806', descr => 'conversion for WIN1251 to MULE_INTERNAL',
+ conname => 'windows_1251_to_mic', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1251_to_mic' },
+{ oid => '4807', descr => 'conversion for MULE_INTERNAL to WIN1251',
+ conname => 'mic_to_windows_1251', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1251', conproc => 'mic_to_win1251' },
+{ oid => '4808', descr => 'conversion for WIN866 to MULE_INTERNAL',
+ conname => 'windows_866_to_mic', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win866_to_mic' },
+{ oid => '4809', descr => 'conversion for MULE_INTERNAL to WIN866',
+ conname => 'mic_to_windows_866', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN866', conproc => 'mic_to_win866' },
+{ oid => '4810', descr => 'conversion for KOI8R to WIN1251',
+ conname => 'koi8_r_to_windows_1251', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN1251', conproc => 'koi8r_to_win1251' },
+{ oid => '4811', descr => 'conversion for WIN1251 to KOI8R',
+ conname => 'windows_1251_to_koi8_r', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_KOI8R', conproc => 'win1251_to_koi8r' },
+{ oid => '4812', descr => 'conversion for KOI8R to WIN866',
+ conname => 'koi8_r_to_windows_866', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_WIN866', conproc => 'koi8r_to_win866' },
+{ oid => '4813', descr => 'conversion for WIN866 to KOI8R',
+ conname => 'windows_866_to_koi8_r', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_KOI8R', conproc => 'win866_to_koi8r' },
+{ oid => '4814', descr => 'conversion for WIN866 to WIN1251',
+ conname => 'windows_866_to_windows_1251', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_WIN1251', conproc => 'win866_to_win1251' },
+{ oid => '4815', descr => 'conversion for WIN1251 to WIN866',
+ conname => 'windows_1251_to_windows_866', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_WIN866', conproc => 'win1251_to_win866' },
+{ oid => '4816', descr => 'conversion for ISO-8859-5 to KOI8R',
+ conname => 'iso_8859_5_to_koi8_r', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_KOI8R', conproc => 'iso_to_koi8r' },
+{ oid => '4817', descr => 'conversion for KOI8R to ISO-8859-5',
+ conname => 'koi8_r_to_iso_8859_5', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'koi8r_to_iso' },
+{ oid => '4818', descr => 'conversion for ISO-8859-5 to WIN1251',
+ conname => 'iso_8859_5_to_windows_1251', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN1251', conproc => 'iso_to_win1251' },
+{ oid => '4819', descr => 'conversion for WIN1251 to ISO-8859-5',
+ conname => 'windows_1251_to_iso_8859_5', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win1251_to_iso' },
+{ oid => '4820', descr => 'conversion for ISO-8859-5 to WIN866',
+ conname => 'iso_8859_5_to_windows_866', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_WIN866', conproc => 'iso_to_win866' },
+{ oid => '4821', descr => 'conversion for WIN866 to ISO-8859-5',
+ conname => 'windows_866_to_iso_8859_5', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'win866_to_iso' },
+{ oid => '4822', descr => 'conversion for EUC_CN to MULE_INTERNAL',
+ conname => 'euc_cn_to_mic', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_cn_to_mic' },
+{ oid => '4823', descr => 'conversion for MULE_INTERNAL to EUC_CN',
+ conname => 'mic_to_euc_cn', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_CN', conproc => 'mic_to_euc_cn' },
+{ oid => '4824', descr => 'conversion for EUC_JP to SJIS',
+ conname => 'euc_jp_to_sjis', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_SJIS', conproc => 'euc_jp_to_sjis' },
+{ oid => '4825', descr => 'conversion for SJIS to EUC_JP',
+ conname => 'sjis_to_euc_jp', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_EUC_JP', conproc => 'sjis_to_euc_jp' },
+{ oid => '4826', descr => 'conversion for EUC_JP to MULE_INTERNAL',
+ conname => 'euc_jp_to_mic', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_jp_to_mic' },
+{ oid => '4827', descr => 'conversion for SJIS to MULE_INTERNAL',
+ conname => 'sjis_to_mic', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'sjis_to_mic' },
+{ oid => '4828', descr => 'conversion for MULE_INTERNAL to EUC_JP',
+ conname => 'mic_to_euc_jp', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_JP', conproc => 'mic_to_euc_jp' },
+{ oid => '4829', descr => 'conversion for MULE_INTERNAL to SJIS',
+ conname => 'mic_to_sjis', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_SJIS', conproc => 'mic_to_sjis' },
+{ oid => '4830', descr => 'conversion for EUC_KR to MULE_INTERNAL',
+ conname => 'euc_kr_to_mic', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_kr_to_mic' },
+{ oid => '4831', descr => 'conversion for MULE_INTERNAL to EUC_KR',
+ conname => 'mic_to_euc_kr', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_KR', conproc => 'mic_to_euc_kr' },
+{ oid => '4832', descr => 'conversion for EUC_TW to BIG5',
+ conname => 'euc_tw_to_big5', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_BIG5', conproc => 'euc_tw_to_big5' },
+{ oid => '4833', descr => 'conversion for BIG5 to EUC_TW',
+ conname => 'big5_to_euc_tw', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_EUC_TW', conproc => 'big5_to_euc_tw' },
+{ oid => '4834', descr => 'conversion for EUC_TW to MULE_INTERNAL',
+ conname => 'euc_tw_to_mic', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'euc_tw_to_mic' },
+{ oid => '4835', descr => 'conversion for BIG5 to MULE_INTERNAL',
+ conname => 'big5_to_mic', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'big5_to_mic' },
+{ oid => '4836', descr => 'conversion for MULE_INTERNAL to EUC_TW',
+ conname => 'mic_to_euc_tw', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_EUC_TW', conproc => 'mic_to_euc_tw' },
+{ oid => '4837', descr => 'conversion for MULE_INTERNAL to BIG5',
+ conname => 'mic_to_big5', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_BIG5', conproc => 'mic_to_big5' },
+{ oid => '4838', descr => 'conversion for LATIN2 to MULE_INTERNAL',
+ conname => 'iso_8859_2_to_mic', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin2_to_mic' },
+{ oid => '4839', descr => 'conversion for MULE_INTERNAL to LATIN2',
+ conname => 'mic_to_iso_8859_2', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN2', conproc => 'mic_to_latin2' },
+{ oid => '4840', descr => 'conversion for WIN1250 to MULE_INTERNAL',
+ conname => 'windows_1250_to_mic', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'win1250_to_mic' },
+{ oid => '4841', descr => 'conversion for MULE_INTERNAL to WIN1250',
+ conname => 'mic_to_windows_1250', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_WIN1250', conproc => 'mic_to_win1250' },
+{ oid => '4842', descr => 'conversion for LATIN2 to WIN1250',
+ conname => 'iso_8859_2_to_windows_1250', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_WIN1250', conproc => 'latin2_to_win1250' },
+{ oid => '4843', descr => 'conversion for WIN1250 to LATIN2',
+ conname => 'windows_1250_to_iso_8859_2', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_LATIN2', conproc => 'win1250_to_latin2' },
+{ oid => '4844', descr => 'conversion for LATIN1 to MULE_INTERNAL',
+ conname => 'iso_8859_1_to_mic', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin1_to_mic' },
+{ oid => '4845', descr => 'conversion for MULE_INTERNAL to LATIN1',
+ conname => 'mic_to_iso_8859_1', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN1', conproc => 'mic_to_latin1' },
+{ oid => '4846', descr => 'conversion for LATIN3 to MULE_INTERNAL',
+ conname => 'iso_8859_3_to_mic', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin3_to_mic' },
+{ oid => '4847', descr => 'conversion for MULE_INTERNAL to LATIN3',
+ conname => 'mic_to_iso_8859_3', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN3', conproc => 'mic_to_latin3' },
+{ oid => '4848', descr => 'conversion for LATIN4 to MULE_INTERNAL',
+ conname => 'iso_8859_4_to_mic', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_MULE_INTERNAL', conproc => 'latin4_to_mic' },
+{ oid => '4849', descr => 'conversion for MULE_INTERNAL to LATIN4',
+ conname => 'mic_to_iso_8859_4', conforencoding => 'PG_MULE_INTERNAL',
+ contoencoding => 'PG_LATIN4', conproc => 'mic_to_latin4' },
+{ oid => '4850', descr => 'conversion for SQL_ASCII to UTF8',
+ conname => 'ascii_to_utf8', conforencoding => 'PG_SQL_ASCII',
+ contoencoding => 'PG_UTF8', conproc => 'ascii_to_utf8' },
+{ oid => '4851', descr => 'conversion for UTF8 to SQL_ASCII',
+ conname => 'utf8_to_ascii', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SQL_ASCII', conproc => 'utf8_to_ascii' },
+{ oid => '4852', descr => 'conversion for BIG5 to UTF8',
+ conname => 'big5_to_utf8', conforencoding => 'PG_BIG5',
+ contoencoding => 'PG_UTF8', conproc => 'big5_to_utf8' },
+{ oid => '4853', descr => 'conversion for UTF8 to BIG5',
+ conname => 'utf8_to_big5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_BIG5', conproc => 'utf8_to_big5' },
+{ oid => '4854', descr => 'conversion for UTF8 to KOI8R',
+ conname => 'utf8_to_koi8_r', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8R', conproc => 'utf8_to_koi8r' },
+{ oid => '4855', descr => 'conversion for KOI8R to UTF8',
+ conname => 'koi8_r_to_utf8', conforencoding => 'PG_KOI8R',
+ contoencoding => 'PG_UTF8', conproc => 'koi8r_to_utf8' },
+{ oid => '4856', descr => 'conversion for UTF8 to KOI8U',
+ conname => 'utf8_to_koi8_u', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_KOI8U', conproc => 'utf8_to_koi8u' },
+{ oid => '4857', descr => 'conversion for KOI8U to UTF8',
+ conname => 'koi8_u_to_utf8', conforencoding => 'PG_KOI8U',
+ contoencoding => 'PG_UTF8', conproc => 'koi8u_to_utf8' },
+{ oid => '4858', descr => 'conversion for UTF8 to WIN866',
+ conname => 'utf8_to_windows_866', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN866', conproc => 'utf8_to_win' },
+{ oid => '4859', descr => 'conversion for WIN866 to UTF8',
+ conname => 'windows_866_to_utf8', conforencoding => 'PG_WIN866',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4860', descr => 'conversion for UTF8 to WIN874',
+ conname => 'utf8_to_windows_874', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN874', conproc => 'utf8_to_win' },
+{ oid => '4861', descr => 'conversion for WIN874 to UTF8',
+ conname => 'windows_874_to_utf8', conforencoding => 'PG_WIN874',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4862', descr => 'conversion for UTF8 to WIN1250',
+ conname => 'utf8_to_windows_1250', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1250', conproc => 'utf8_to_win' },
+{ oid => '4863', descr => 'conversion for WIN1250 to UTF8',
+ conname => 'windows_1250_to_utf8', conforencoding => 'PG_WIN1250',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4864', descr => 'conversion for UTF8 to WIN1251',
+ conname => 'utf8_to_windows_1251', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1251', conproc => 'utf8_to_win' },
+{ oid => '4865', descr => 'conversion for WIN1251 to UTF8',
+ conname => 'windows_1251_to_utf8', conforencoding => 'PG_WIN1251',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4866', descr => 'conversion for UTF8 to WIN1252',
+ conname => 'utf8_to_windows_1252', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1252', conproc => 'utf8_to_win' },
+{ oid => '4867', descr => 'conversion for WIN1252 to UTF8',
+ conname => 'windows_1252_to_utf8', conforencoding => 'PG_WIN1252',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4868', descr => 'conversion for UTF8 to WIN1253',
+ conname => 'utf8_to_windows_1253', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1253', conproc => 'utf8_to_win' },
+{ oid => '4869', descr => 'conversion for WIN1253 to UTF8',
+ conname => 'windows_1253_to_utf8', conforencoding => 'PG_WIN1253',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4870', descr => 'conversion for UTF8 to WIN1254',
+ conname => 'utf8_to_windows_1254', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1254', conproc => 'utf8_to_win' },
+{ oid => '4871', descr => 'conversion for WIN1254 to UTF8',
+ conname => 'windows_1254_to_utf8', conforencoding => 'PG_WIN1254',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4872', descr => 'conversion for UTF8 to WIN1255',
+ conname => 'utf8_to_windows_1255', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1255', conproc => 'utf8_to_win' },
+{ oid => '4873', descr => 'conversion for WIN1255 to UTF8',
+ conname => 'windows_1255_to_utf8', conforencoding => 'PG_WIN1255',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4874', descr => 'conversion for UTF8 to WIN1256',
+ conname => 'utf8_to_windows_1256', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1256', conproc => 'utf8_to_win' },
+{ oid => '4875', descr => 'conversion for WIN1256 to UTF8',
+ conname => 'windows_1256_to_utf8', conforencoding => 'PG_WIN1256',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4876', descr => 'conversion for UTF8 to WIN1257',
+ conname => 'utf8_to_windows_1257', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1257', conproc => 'utf8_to_win' },
+{ oid => '4877', descr => 'conversion for WIN1257 to UTF8',
+ conname => 'windows_1257_to_utf8', conforencoding => 'PG_WIN1257',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4878', descr => 'conversion for UTF8 to WIN1258',
+ conname => 'utf8_to_windows_1258', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_WIN1258', conproc => 'utf8_to_win' },
+{ oid => '4879', descr => 'conversion for WIN1258 to UTF8',
+ conname => 'windows_1258_to_utf8', conforencoding => 'PG_WIN1258',
+ contoencoding => 'PG_UTF8', conproc => 'win_to_utf8' },
+{ oid => '4880', descr => 'conversion for EUC_CN to UTF8',
+ conname => 'euc_cn_to_utf8', conforencoding => 'PG_EUC_CN',
+ contoencoding => 'PG_UTF8', conproc => 'euc_cn_to_utf8' },
+{ oid => '4881', descr => 'conversion for UTF8 to EUC_CN',
+ conname => 'utf8_to_euc_cn', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_CN', conproc => 'utf8_to_euc_cn' },
+{ oid => '4882', descr => 'conversion for EUC_JP to UTF8',
+ conname => 'euc_jp_to_utf8', conforencoding => 'PG_EUC_JP',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jp_to_utf8' },
+{ oid => '4883', descr => 'conversion for UTF8 to EUC_JP',
+ conname => 'utf8_to_euc_jp', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JP', conproc => 'utf8_to_euc_jp' },
+{ oid => '4884', descr => 'conversion for EUC_KR to UTF8',
+ conname => 'euc_kr_to_utf8', conforencoding => 'PG_EUC_KR',
+ contoencoding => 'PG_UTF8', conproc => 'euc_kr_to_utf8' },
+{ oid => '4885', descr => 'conversion for UTF8 to EUC_KR',
+ conname => 'utf8_to_euc_kr', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_KR', conproc => 'utf8_to_euc_kr' },
+{ oid => '4886', descr => 'conversion for EUC_TW to UTF8',
+ conname => 'euc_tw_to_utf8', conforencoding => 'PG_EUC_TW',
+ contoencoding => 'PG_UTF8', conproc => 'euc_tw_to_utf8' },
+{ oid => '4887', descr => 'conversion for UTF8 to EUC_TW',
+ conname => 'utf8_to_euc_tw', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_TW', conproc => 'utf8_to_euc_tw' },
+{ oid => '4888', descr => 'conversion for GB18030 to UTF8',
+ conname => 'gb18030_to_utf8', conforencoding => 'PG_GB18030',
+ contoencoding => 'PG_UTF8', conproc => 'gb18030_to_utf8' },
+{ oid => '4889', descr => 'conversion for UTF8 to GB18030',
+ conname => 'utf8_to_gb18030', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GB18030', conproc => 'utf8_to_gb18030' },
+{ oid => '4890', descr => 'conversion for GBK to UTF8',
+ conname => 'gbk_to_utf8', conforencoding => 'PG_GBK',
+ contoencoding => 'PG_UTF8', conproc => 'gbk_to_utf8' },
+{ oid => '4891', descr => 'conversion for UTF8 to GBK',
+ conname => 'utf8_to_gbk', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_GBK', conproc => 'utf8_to_gbk' },
+{ oid => '4892', descr => 'conversion for UTF8 to LATIN2',
+ conname => 'utf8_to_iso_8859_2', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN2', conproc => 'utf8_to_iso8859' },
+{ oid => '4893', descr => 'conversion for LATIN2 to UTF8',
+ conname => 'iso_8859_2_to_utf8', conforencoding => 'PG_LATIN2',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4894', descr => 'conversion for UTF8 to LATIN3',
+ conname => 'utf8_to_iso_8859_3', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN3', conproc => 'utf8_to_iso8859' },
+{ oid => '4895', descr => 'conversion for LATIN3 to UTF8',
+ conname => 'iso_8859_3_to_utf8', conforencoding => 'PG_LATIN3',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4896', descr => 'conversion for UTF8 to LATIN4',
+ conname => 'utf8_to_iso_8859_4', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN4', conproc => 'utf8_to_iso8859' },
+{ oid => '4897', descr => 'conversion for LATIN4 to UTF8',
+ conname => 'iso_8859_4_to_utf8', conforencoding => 'PG_LATIN4',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4898', descr => 'conversion for UTF8 to LATIN5',
+ conname => 'utf8_to_iso_8859_9', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN5', conproc => 'utf8_to_iso8859' },
+{ oid => '4899', descr => 'conversion for LATIN5 to UTF8',
+ conname => 'iso_8859_9_to_utf8', conforencoding => 'PG_LATIN5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4900', descr => 'conversion for UTF8 to LATIN6',
+ conname => 'utf8_to_iso_8859_10', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN6', conproc => 'utf8_to_iso8859' },
+{ oid => '4901', descr => 'conversion for LATIN6 to UTF8',
+ conname => 'iso_8859_10_to_utf8', conforencoding => 'PG_LATIN6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4902', descr => 'conversion for UTF8 to LATIN7',
+ conname => 'utf8_to_iso_8859_13', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN7', conproc => 'utf8_to_iso8859' },
+{ oid => '4903', descr => 'conversion for LATIN7 to UTF8',
+ conname => 'iso_8859_13_to_utf8', conforencoding => 'PG_LATIN7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4904', descr => 'conversion for UTF8 to LATIN8',
+ conname => 'utf8_to_iso_8859_14', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN8', conproc => 'utf8_to_iso8859' },
+{ oid => '4905', descr => 'conversion for LATIN8 to UTF8',
+ conname => 'iso_8859_14_to_utf8', conforencoding => 'PG_LATIN8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4906', descr => 'conversion for UTF8 to LATIN9',
+ conname => 'utf8_to_iso_8859_15', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN9', conproc => 'utf8_to_iso8859' },
+{ oid => '4907', descr => 'conversion for LATIN9 to UTF8',
+ conname => 'iso_8859_15_to_utf8', conforencoding => 'PG_LATIN9',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4908', descr => 'conversion for UTF8 to LATIN10',
+ conname => 'utf8_to_iso_8859_16', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN10', conproc => 'utf8_to_iso8859' },
+{ oid => '4909', descr => 'conversion for LATIN10 to UTF8',
+ conname => 'iso_8859_16_to_utf8', conforencoding => 'PG_LATIN10',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4910', descr => 'conversion for UTF8 to ISO-8859-5',
+ conname => 'utf8_to_iso_8859_5', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_5', conproc => 'utf8_to_iso8859' },
+{ oid => '4911', descr => 'conversion for ISO-8859-5 to UTF8',
+ conname => 'iso_8859_5_to_utf8', conforencoding => 'PG_ISO_8859_5',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4912', descr => 'conversion for UTF8 to ISO-8859-6',
+ conname => 'utf8_to_iso_8859_6', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_6', conproc => 'utf8_to_iso8859' },
+{ oid => '4913', descr => 'conversion for ISO-8859-6 to UTF8',
+ conname => 'iso_8859_6_to_utf8', conforencoding => 'PG_ISO_8859_6',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4914', descr => 'conversion for UTF8 to ISO-8859-7',
+ conname => 'utf8_to_iso_8859_7', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_7', conproc => 'utf8_to_iso8859' },
+{ oid => '4915', descr => 'conversion for ISO-8859-7 to UTF8',
+ conname => 'iso_8859_7_to_utf8', conforencoding => 'PG_ISO_8859_7',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4916', descr => 'conversion for UTF8 to ISO-8859-8',
+ conname => 'utf8_to_iso_8859_8', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_ISO_8859_8', conproc => 'utf8_to_iso8859' },
+{ oid => '4917', descr => 'conversion for ISO-8859-8 to UTF8',
+ conname => 'iso_8859_8_to_utf8', conforencoding => 'PG_ISO_8859_8',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_to_utf8' },
+{ oid => '4918', descr => 'conversion for LATIN1 to UTF8',
+ conname => 'iso_8859_1_to_utf8', conforencoding => 'PG_LATIN1',
+ contoencoding => 'PG_UTF8', conproc => 'iso8859_1_to_utf8' },
+{ oid => '4919', descr => 'conversion for UTF8 to LATIN1',
+ conname => 'utf8_to_iso_8859_1', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_LATIN1', conproc => 'utf8_to_iso8859_1' },
+{ oid => '4920', descr => 'conversion for JOHAB to UTF8',
+ conname => 'johab_to_utf8', conforencoding => 'PG_JOHAB',
+ contoencoding => 'PG_UTF8', conproc => 'johab_to_utf8' },
+{ oid => '4921', descr => 'conversion for UTF8 to JOHAB',
+ conname => 'utf8_to_johab', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_JOHAB', conproc => 'utf8_to_johab' },
+{ oid => '4922', descr => 'conversion for SJIS to UTF8',
+ conname => 'sjis_to_utf8', conforencoding => 'PG_SJIS',
+ contoencoding => 'PG_UTF8', conproc => 'sjis_to_utf8' },
+{ oid => '4923', descr => 'conversion for UTF8 to SJIS',
+ conname => 'utf8_to_sjis', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SJIS', conproc => 'utf8_to_sjis' },
+{ oid => '4924', descr => 'conversion for UHC to UTF8',
+ conname => 'uhc_to_utf8', conforencoding => 'PG_UHC',
+ contoencoding => 'PG_UTF8', conproc => 'uhc_to_utf8' },
+{ oid => '4925', descr => 'conversion for UTF8 to UHC',
+ conname => 'utf8_to_uhc', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_UHC', conproc => 'utf8_to_uhc' },
+{ oid => '4926', descr => 'conversion for EUC_JIS_2004 to UTF8',
+ conname => 'euc_jis_2004_to_utf8', conforencoding => 'PG_EUC_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'euc_jis_2004_to_utf8' },
+{ oid => '4927', descr => 'conversion for UTF8 to EUC_JIS_2004',
+ conname => 'utf8_to_euc_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_EUC_JIS_2004', conproc => 'utf8_to_euc_jis_2004' },
+{ oid => '4928', descr => 'conversion for SHIFT_JIS_2004 to UTF8',
+ conname => 'shift_jis_2004_to_utf8', conforencoding => 'PG_SHIFT_JIS_2004',
+ contoencoding => 'PG_UTF8', conproc => 'shift_jis_2004_to_utf8' },
+{ oid => '4929', descr => 'conversion for UTF8 to SHIFT_JIS_2004',
+ conname => 'utf8_to_shift_jis_2004', conforencoding => 'PG_UTF8',
+ contoencoding => 'PG_SHIFT_JIS_2004', conproc => 'utf8_to_shift_jis_2004' },
+{ oid => '4930', descr => 'conversion for EUC_JIS_2004 to SHIFT_JIS_2004',
+ conname => 'euc_jis_2004_to_shift_jis_2004',
+ conforencoding => 'PG_EUC_JIS_2004', contoencoding => 'PG_SHIFT_JIS_2004',
+ conproc => 'euc_jis_2004_to_shift_jis_2004' },
+{ oid => '4931', descr => 'conversion for SHIFT_JIS_2004 to EUC_JIS_2004',
+ conname => 'shift_jis_2004_to_euc_jis_2004',
+ conforencoding => 'PG_SHIFT_JIS_2004', contoencoding => 'PG_EUC_JIS_2004',
+ conproc => 'shift_jis_2004_to_euc_jis_2004' },
+
+]
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 6e8f054306..9f31d41272 100644
--- a/src/include/catalog/pg_conversion.h
+++ b/src/include/catalog/pg_conversion.h
@@ -23,30 +23,41 @@
#include "catalog/objectaddress.h"
-/* ----------------------------------------------------------------
- * pg_conversion definition.
- *
- * cpp turns this into typedef struct FormData_pg_namespace
- *
- * conname name of the conversion
- * connamespace name space which the conversion belongs to
- * conowner owner of the conversion
- * conforencoding FOR encoding id
- * contoencoding TO encoding id
- * conproc OID of the conversion proc
- * condefault true if this is a default conversion
- * ----------------------------------------------------------------
+/* ----------------
+ * pg_conversion definition. cpp turns this into
+ * typedef struct FormData_pg_conversion
+ * ----------------
*/
CATALOG(pg_conversion,2607,ConversionRelationId)
{
- Oid oid; /* oid */
+ /* oid */
+ Oid oid;
+
+ /* name of the conversion */
NameData conname;
- Oid connamespace;
- Oid conowner;
- int32 conforencoding;
- int32 contoencoding;
- regproc conproc;
- bool condefault;
+
+ /* name space which the conversion belongs to */
+ Oid connamespace BKI_DEFAULT(PGNSP);
+
+ /* owner of the conversion */
+ Oid conowner BKI_DEFAULT(PGUID);
+
+ /*
+ * Note: The encoding lookups don't refer to other catalogs,
+ * but to values found in mb/pg_wchar.h
+ */
+
+ /* FOR encoding id */
+ int32 conforencoding BKI_LOOKUP(encoding);
+
+ /* TO encoding id */
+ int32 contoencoding BKI_LOOKUP(encoding);
+
+ /* OID of the conversion proc */
+ regproc conproc BKI_LOOKUP(pg_proc);
+
+ /* true if this is a default conversion */
+ bool condefault BKI_DEFAULT(t);
} FormData_pg_conversion;
/* ----------------
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index c8c27948f0..77f124290d 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -21,7 +21,7 @@
# Try to follow the style of existing functions' comments.
# Some recommended conventions:
-
+#
# "I/O" for typinput, typoutput, typreceive, typsend functions
# "I/O typmod" for typmodin, typmodout functions
# "aggregate transition function" for aggtransfn functions, unless
@@ -10048,4 +10048,412 @@
proargnames => '{rootrelid,relid,parentrelid,isleaf,level}',
prosrc => 'pg_partition_tree' },
+# conversion functions
+{ oid => '4600',
+ descr => 'internal conversion function for SQL_ASCII to MULE_INTERNAL',
+ proname => 'ascii_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_mic',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4601',
+ descr => 'internal conversion function for MULE_INTERNAL to SQL_ASCII',
+ proname => 'mic_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_ascii',
+ probin => '$libdir/ascii_and_mic' },
+{ oid => '4602',
+ descr => 'internal conversion function for KOI8R to MULE_INTERNAL',
+ proname => 'koi8r_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4603',
+ descr => 'internal conversion function for MULE_INTERNAL to KOI8R',
+ proname => 'mic_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4604',
+ descr => 'internal conversion function for ISO-8859-5 to MULE_INTERNAL',
+ proname => 'iso_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4605',
+ descr => 'internal conversion function for MULE_INTERNAL to ISO-8859-5',
+ proname => 'mic_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4606',
+ descr => 'internal conversion function for WIN1251 to MULE_INTERNAL',
+ proname => 'win1251_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4607',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1251',
+ proname => 'mic_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4608',
+ descr => 'internal conversion function for WIN866 to MULE_INTERNAL',
+ proname => 'win866_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_mic',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4609',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN866',
+ proname => 'mic_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4610', descr => 'internal conversion function for KOI8R to WIN1251',
+ proname => 'koi8r_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'koi8r_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4611', descr => 'internal conversion function for WIN1251 to KOI8R',
+ proname => 'win1251_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_koi8r', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4612', descr => 'internal conversion function for KOI8R to WIN866',
+ proname => 'koi8r_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4613', descr => 'internal conversion function for WIN866 to KOI8R',
+ proname => 'win866_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4614',
+ descr => 'internal conversion function for WIN866 to WIN1251',
+ proname => 'win866_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win866_to_win1251', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4615',
+ descr => 'internal conversion function for WIN1251 to WIN866',
+ proname => 'win1251_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1251_to_win866', probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4616',
+ descr => 'internal conversion function for ISO-8859-5 to KOI8R',
+ proname => 'iso_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_koi8r',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4617',
+ descr => 'internal conversion function for KOI8R to ISO-8859-5',
+ proname => 'koi8r_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4618',
+ descr => 'internal conversion function for ISO-8859-5 to WIN1251',
+ proname => 'iso_to_win1251', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win1251',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4619',
+ descr => 'internal conversion function for WIN1251 to ISO-8859-5',
+ proname => 'win1251_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1251_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4620',
+ descr => 'internal conversion function for ISO-8859-5 to WIN866',
+ proname => 'iso_to_win866', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso_to_win866',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4621',
+ descr => 'internal conversion function for WIN866 to ISO-8859-5',
+ proname => 'win866_to_iso', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win866_to_iso',
+ probin => '$libdir/cyrillic_and_mic' },
+{ oid => '4622',
+ descr => 'internal conversion function for EUC_CN to MULE_INTERNAL',
+ proname => 'euc_cn_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_mic',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4623',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_CN',
+ proname => 'mic_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_cn',
+ probin => '$libdir/euc_cn_and_mic' },
+{ oid => '4624', descr => 'internal conversion function for EUC_JP to SJIS',
+ proname => 'euc_jp_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4625', descr => 'internal conversion function for SJIS to EUC_JP',
+ proname => 'sjis_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4626',
+ descr => 'internal conversion function for EUC_JP to MULE_INTERNAL',
+ proname => 'euc_jp_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4627',
+ descr => 'internal conversion function for SJIS to MULE_INTERNAL',
+ proname => 'sjis_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_mic',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4628',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_JP',
+ proname => 'mic_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_jp',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4629',
+ descr => 'internal conversion function for MULE_INTERNAL to SJIS',
+ proname => 'mic_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_sjis',
+ probin => '$libdir/euc_jp_and_sjis' },
+{ oid => '4630',
+ descr => 'internal conversion function for EUC_KR to MULE_INTERNAL',
+ proname => 'euc_kr_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_mic',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4631',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_KR',
+ proname => 'mic_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_kr',
+ probin => '$libdir/euc_kr_and_mic' },
+{ oid => '4632', descr => 'internal conversion function for EUC_TW to BIG5',
+ proname => 'euc_tw_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4633', descr => 'internal conversion function for BIG5 to EUC_TW',
+ proname => 'big5_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4634',
+ descr => 'internal conversion function for EUC_TW to MULE_INTERNAL',
+ proname => 'euc_tw_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4635',
+ descr => 'internal conversion function for BIG5 to MULE_INTERNAL',
+ proname => 'big5_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_mic',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4636',
+ descr => 'internal conversion function for MULE_INTERNAL to EUC_TW',
+ proname => 'mic_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_euc_tw',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4637',
+ descr => 'internal conversion function for MULE_INTERNAL to BIG5',
+ proname => 'mic_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_big5',
+ probin => '$libdir/euc_tw_and_big5' },
+{ oid => '4638',
+ descr => 'internal conversion function for LATIN2 to MULE_INTERNAL',
+ proname => 'latin2_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin2_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4639',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN2',
+ proname => 'mic_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin2',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4640',
+ descr => 'internal conversion function for WIN1250 to MULE_INTERNAL',
+ proname => 'win1250_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win1250_to_mic',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4641',
+ descr => 'internal conversion function for MULE_INTERNAL to WIN1250',
+ proname => 'mic_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_win1250',
+ probin => '$libdir/latin2_and_win1250' },
+{ oid => '4642',
+ descr => 'internal conversion function for LATIN2 to WIN1250',
+ proname => 'latin2_to_win1250', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'latin2_to_win1250', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4643',
+ descr => 'internal conversion function for WIN1250 to LATIN2',
+ proname => 'win1250_to_latin2', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'win1250_to_latin2', probin => '$libdir/latin2_and_win1250' },
+{ oid => '4644',
+ descr => 'internal conversion function for LATIN1 to MULE_INTERNAL',
+ proname => 'latin1_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin1_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4645',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN1',
+ proname => 'mic_to_latin1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin1',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4646',
+ descr => 'internal conversion function for LATIN3 to MULE_INTERNAL',
+ proname => 'latin3_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin3_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4647',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN3',
+ proname => 'mic_to_latin3', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin3',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4648',
+ descr => 'internal conversion function for LATIN4 to MULE_INTERNAL',
+ proname => 'latin4_to_mic', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'latin4_to_mic',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4649',
+ descr => 'internal conversion function for MULE_INTERNAL to LATIN4',
+ proname => 'mic_to_latin4', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'mic_to_latin4',
+ probin => '$libdir/latin_and_mic' },
+{ oid => '4650',
+ descr => 'internal conversion function for SQL_ASCII to UTF8',
+ proname => 'ascii_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'ascii_to_utf8',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4651',
+ descr => 'internal conversion function for UTF8 to SQL_ASCII',
+ proname => 'utf8_to_ascii', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_ascii',
+ probin => '$libdir/utf8_and_ascii' },
+{ oid => '4652', descr => 'internal conversion function for BIG5 to UTF8',
+ proname => 'big5_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'big5_to_utf8',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4653', descr => 'internal conversion function for UTF8 to BIG5',
+ proname => 'utf8_to_big5', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_big5',
+ probin => '$libdir/utf8_and_big5' },
+{ oid => '4654', descr => 'internal conversion function for UTF8 to KOI8R',
+ proname => 'utf8_to_koi8r', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8r',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4655', descr => 'internal conversion function for KOI8R to UTF8',
+ proname => 'koi8r_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8r_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4656', descr => 'internal conversion function for UTF8 to KOI8U',
+ proname => 'utf8_to_koi8u', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_koi8u',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4657', descr => 'internal conversion function for KOI8U to UTF8',
+ proname => 'koi8u_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'koi8u_to_utf8',
+ probin => '$libdir/utf8_and_cyrillic' },
+{ oid => '4658', descr => 'internal conversion function for UTF8 to WIN',
+ proname => 'utf8_to_win', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_win',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4659', descr => 'internal conversion function for WIN to UTF8',
+ proname => 'win_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'win_to_utf8',
+ probin => '$libdir/utf8_and_win' },
+{ oid => '4660', descr => 'internal conversion function for EUC_CN to UTF8',
+ proname => 'euc_cn_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_cn_to_utf8',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4661', descr => 'internal conversion function for UTF8 to EUC_CN',
+ proname => 'utf8_to_euc_cn', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_cn',
+ probin => '$libdir/utf8_and_euc_cn' },
+{ oid => '4662', descr => 'internal conversion function for EUC_JP to UTF8',
+ proname => 'euc_jp_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_jp_to_utf8',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4663', descr => 'internal conversion function for UTF8 to EUC_JP',
+ proname => 'utf8_to_euc_jp', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_jp',
+ probin => '$libdir/utf8_and_euc_jp' },
+{ oid => '4664', descr => 'internal conversion function for EUC_KR to UTF8',
+ proname => 'euc_kr_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_kr_to_utf8',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4665', descr => 'internal conversion function for UTF8 to EUC_KR',
+ proname => 'utf8_to_euc_kr', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_kr',
+ probin => '$libdir/utf8_and_euc_kr' },
+{ oid => '4666', descr => 'internal conversion function for EUC_TW to UTF8',
+ proname => 'euc_tw_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'euc_tw_to_utf8',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4667', descr => 'internal conversion function for UTF8 to EUC_TW',
+ proname => 'utf8_to_euc_tw', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_euc_tw',
+ probin => '$libdir/utf8_and_euc_tw' },
+{ oid => '4668', descr => 'internal conversion function for GB18030 to UTF8',
+ proname => 'gb18030_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gb18030_to_utf8',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4669', descr => 'internal conversion function for UTF8 to GB18030',
+ proname => 'utf8_to_gb18030', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gb18030',
+ probin => '$libdir/utf8_and_gb18030' },
+{ oid => '4670', descr => 'internal conversion function for GBK to UTF8',
+ proname => 'gbk_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'gbk_to_utf8',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4671', descr => 'internal conversion function for UTF8 to GBK',
+ proname => 'utf8_to_gbk', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_gbk',
+ probin => '$libdir/utf8_and_gbk' },
+{ oid => '4672',
+ descr => 'internal conversion function for UTF8 to ISO-8859 2-16',
+ proname => 'utf8_to_iso8859', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_iso8859',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4673',
+ descr => 'internal conversion function for ISO-8859 2-16 to UTF8',
+ proname => 'iso8859_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'iso8859_to_utf8',
+ probin => '$libdir/utf8_and_iso8859' },
+{ oid => '4674', descr => 'internal conversion function for LATIN1 to UTF8',
+ proname => 'iso8859_1_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'iso8859_1_to_utf8', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4675', descr => 'internal conversion function for UTF8 to LATIN1',
+ proname => 'utf8_to_iso8859_1', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_iso8859_1', probin => '$libdir/utf8_and_iso8859_1' },
+{ oid => '4676', descr => 'internal conversion function for JOHAB to UTF8',
+ proname => 'johab_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'johab_to_utf8',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4677', descr => 'internal conversion function for UTF8 to JOHAB',
+ proname => 'utf8_to_johab', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_johab',
+ probin => '$libdir/utf8_and_johab' },
+{ oid => '4678', descr => 'internal conversion function for SJIS to UTF8',
+ proname => 'sjis_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'sjis_to_utf8',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4679', descr => 'internal conversion function for UTF8 to SJIS',
+ proname => 'utf8_to_sjis', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_sjis',
+ probin => '$libdir/utf8_and_sjis' },
+{ oid => '4680', descr => 'internal conversion function for UHC to UTF8',
+ proname => 'uhc_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'uhc_to_utf8',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4681', descr => 'internal conversion function for UTF8 to UHC',
+ proname => 'utf8_to_uhc', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4', prosrc => 'utf8_to_uhc',
+ probin => '$libdir/utf8_and_uhc' },
+{ oid => '4682',
+ descr => 'internal conversion function for EUC_JIS_2004 to UTF8',
+ proname => 'euc_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_utf8', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4683',
+ descr => 'internal conversion function for UTF8 to EUC_JIS_2004',
+ proname => 'utf8_to_euc_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_euc_jis_2004', probin => '$libdir/utf8_and_euc2004' },
+{ oid => '4684',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to UTF8',
+ proname => 'shift_jis_2004_to_utf8', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_utf8', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4685',
+ descr => 'internal conversion function for UTF8 to SHIFT_JIS_2004',
+ proname => 'utf8_to_shift_jis_2004', prolang => 'c', prorettype => 'void',
+ proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'utf8_to_shift_jis_2004', probin => '$libdir/utf8_and_sjis2004' },
+{ oid => '4686',
+ descr => 'internal conversion function for EUC_JIS_2004 to SHIFT_JIS_2004',
+ proname => 'euc_jis_2004_to_shift_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'euc_jis_2004_to_shift_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+{ oid => '4687',
+ descr => 'internal conversion function for SHIFT_JIS_2004 to EUC_JIS_2004',
+ proname => 'shift_jis_2004_to_euc_jis_2004', prolang => 'c',
+ prorettype => 'void', proargtypes => 'int4 int4 cstring internal int4',
+ prosrc => 'shift_jis_2004_to_euc_jis_2004',
+ probin => '$libdir/euc2004_sjis2004' },
+
]
diff --git a/src/test/regress/expected/misc_sanity.out b/src/test/regress/expected/misc_sanity.out
index 1d4b000acf..8538173ff8 100644
--- a/src/test/regress/expected/misc_sanity.out
+++ b/src/test/regress/expected/misc_sanity.out
@@ -74,7 +74,6 @@ loop
end loop;
end$$;
NOTICE: pg_constraint contains unpinned initdb-created object(s)
-NOTICE: pg_conversion contains unpinned initdb-created object(s)
NOTICE: pg_database contains unpinned initdb-created object(s)
NOTICE: pg_extension contains unpinned initdb-created object(s)
NOTICE: pg_rewrite contains unpinned initdb-created object(s)
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 7e1c9ac848..7494bfa004 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -139,7 +139,6 @@ sub Install
CopyFiles(
'Error code data', $target . '/share/',
'src/backend/utils/', 'errcodes.txt');
- GenerateConversionScript($target);
GenerateTimezoneFiles($target, $conf);
GenerateTsearchFiles($target);
CopySetOfFiles(
@@ -348,44 +347,6 @@ sub CopySolutionOutput
return;
}
-sub GenerateConversionScript
-{
- my $target = shift;
- my $sql = "";
- my $F;
-
- print "Generating conversion proc script...";
- my $mf = read_file('src/backend/utils/mb/conversion_procs/Makefile');
- $mf =~ s{\\\r?\n}{}g;
- $mf =~ /^CONVERSIONS\s*=\s*(.*)$/m
- || die "Could not find CONVERSIONS line in conversions Makefile\n";
- my @pieces = split /\s+/, $1;
- while ($#pieces > 0)
- {
- my $name = shift @pieces;
- my $se = shift @pieces;
- my $de = shift @pieces;
- my $func = shift @pieces;
- my $obj = shift @pieces;
- $sql .= "-- $se --> $de\n";
- $sql .=
- "CREATE OR REPLACE FUNCTION $func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '\$libdir/$obj', '$func' LANGUAGE C STRICT;\n";
- $sql .=
- "COMMENT ON FUNCTION $func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $se to $de';\n";
- $sql .= "DROP CONVERSION pg_catalog.$name;\n";
- $sql .=
- "CREATE DEFAULT CONVERSION pg_catalog.$name FOR '$se' TO '$de' FROM $func;\n";
- $sql .=
- "COMMENT ON CONVERSION pg_catalog.$name IS 'conversion for $se to $de';\n\n";
- }
- open($F, '>', "$target/share/conversion_create.sql")
- || die "Could not write to conversion_create.sql\n";
- print $F $sql;
- close($F);
- print "\n";
- return;
-}
-
sub GenerateTimezoneFiles
{
my $target = shift;
--
2.17.1
John Naylor <jcnaylor@gmail.com> writes:
Since it's been a few months since last discussion, I'd like to
summarize the purpose of this patch and advocate for its inclusion in
v12:
Pushed after some review and correction. Notably, I didn't like
leaving the info about the encoding lookup out of bki.sgml, so
I changed that.
regards, tom lane