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

Commitea0e7cd

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 parent910eb61 commitea0e7cd

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
@@ -1481,6 +1481,12 @@ BeginCopyFrom(ParseState *pstate,
14811481
cstate->need_transcoding= true;
14821482
cstate->conversion_proc=FindDefaultConversionProc(cstate->file_encoding,
14831483
GetDatabaseEncoding());
1484+
if (!OidIsValid(cstate->conversion_proc))
1485+
ereport(ERROR,
1486+
(errcode(ERRCODE_UNDEFINED_FUNCTION),
1487+
errmsg("default conversion function for encoding \"%s\" to \"%s\" does not exist",
1488+
pg_encoding_to_char(cstate->file_encoding),
1489+
pg_encoding_to_char(GetDatabaseEncoding()))));
14841490
}
14851491

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp