Commit ea1b99a
committed
Add 'noError' argument to encoding conversion functions.
With the 'noError' argument, you can try to convert a buffer without
knowing the character boundaries beforehand. The functions now need to
return the number of input bytes successfully converted.
This is is a backwards-incompatible change, if you have created a custom
encoding conversion with CREATE CONVERSION. This adds a check to
pg_upgrade for that, refusing the upgrade if there are any user-defined
encoding conversions. Custom conversions are very rare, there are no
commonly used extensions that I know of that uses that feature. No other
objects can depend on conversions, so if you do have one, you can fairly
easily drop it before upgrading, and recreate it after the upgrade with
an updated version.
Add regression tests for built-in encoding conversions. This doesn't cover
every conversion, but it covers all the internal functions in conv.c that
are used to implement the conversions.
Reviewed-by: John Naylor
Discussion: https://www.postgresql.org/message-id/e7861509-3960-538a-9025-b75a61188e01%40iki.fi1 parent e2639a7 commit ea1b99a
File tree
40 files changed
+2333
-631
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- utils
- error
- mb
- conversion_procs
- cyrillic_and_mic
- euc2004_sjis2004
- euc_cn_and_mic
- euc_jp_and_sjis
- euc_kr_and_mic
- euc_tw_and_big5
- latin2_and_win1250
- latin_and_mic
- utf8_and_big5
- utf8_and_cyrillic
- utf8_and_euc2004
- utf8_and_euc_cn
- utf8_and_euc_jp
- utf8_and_euc_kr
- utf8_and_euc_tw
- utf8_and_gb18030
- utf8_and_gbk
- utf8_and_iso8859_1
- utf8_and_iso8859
- utf8_and_johab
- utf8_and_sjis2004
- utf8_and_sjis
- utf8_and_uhc
- utf8_and_win
- bin/pg_upgrade
- include
- catalog
- mb
- test/regress
- expected
- input
- output
- sql
40 files changed
+2333
-631
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
| 96 | + | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
120 | 132 | | |
121 | 133 | | |
122 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2271 | 2271 | | |
2272 | 2272 | | |
2273 | 2273 | | |
| 2274 | + | |
| 2275 | + | |
2274 | 2276 | | |
2275 | 2277 | | |
2276 | 2278 | | |
| |||
0 commit comments