Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita715c02

Browse files
committed
In COPY FROM, fail cleanly when unsupported encoding conversion is needed.
In recent releases, such cases fail with "cache lookup failed forfunction 0" rather than complaining that the conversion functiondoesn't exist as prior versions did. Seems to be a consequence ofsloppy refactoring in commitf82de5c. Add the missing error check.Per report from Pierre Fortin. Back-patch to v14 where theoversight crept in.Discussion:https://postgr.es/m/20230929163739.3bea46e5.pfortin@pfortin.com
1 parent2d4f99b commita715c02

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/backend/commands/copyfrom.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,12 @@ BeginCopyFrom(ParseState *pstate,
13341334
cstate->need_transcoding= true;
13351335
cstate->conversion_proc=FindDefaultConversionProc(cstate->file_encoding,
13361336
GetDatabaseEncoding());
1337+
if (!OidIsValid(cstate->conversion_proc))
1338+
ereport(ERROR,
1339+
(errcode(ERRCODE_UNDEFINED_FUNCTION),
1340+
errmsg("default conversion function for encoding \"%s\" to \"%s\" does not exist",
1341+
pg_encoding_to_char(cstate->file_encoding),
1342+
pg_encoding_to_char(GetDatabaseEncoding()))));
13371343
}
13381344

13391345
cstate->copy_src=COPY_FILE;/* default */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp