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

Commitd8a0993

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 parent276393f commitd8a0993

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
@@ -1485,6 +1485,12 @@ BeginCopyFrom(ParseState *pstate,
14851485
cstate->need_transcoding= true;
14861486
cstate->conversion_proc=FindDefaultConversionProc(cstate->file_encoding,
14871487
GetDatabaseEncoding());
1488+
if (!OidIsValid(cstate->conversion_proc))
1489+
ereport(ERROR,
1490+
(errcode(ERRCODE_UNDEFINED_FUNCTION),
1491+
errmsg("default conversion function for encoding \"%s\" to \"%s\" does not exist",
1492+
pg_encoding_to_char(cstate->file_encoding),
1493+
pg_encoding_to_char(GetDatabaseEncoding()))));
14881494
}
14891495

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp