暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL 18 preview - file_fdw 最多可跳过的错误行数(REJECT_LIMIT N)

铃木园子 2025-01-16
102

PostgreSQL 18 preview - file_fdw 最多可跳过的错误行数(REJECT_LIMIT N)

作者

digoal

日期

2024-11-21

标签

PostgreSQL , PolarDB , DuckDB , file_fdw , REJECT_LIMIT


背景

《PostgreSQL 18 preview - COPY 最多可跳过的错误行数(REJECT_LIMIT N)》

file_fdw插件也添加了最多可跳过的错误行数(REJECT_LIMIT N)的支持:

+CREATE FOREIGN TABLE tbl () SERVER file_server OPTIONS (reject_limit '1');       -- ERROR  
+ALTER FOREIGN TABLE agg_bad OPTIONS (ADD reject_limit '1'); -- ERROR  
+SELECT * FROM agg_bad;  
+ALTER FOREIGN TABLE agg_bad OPTIONS (SET reject_limit '2');  
+SELECT * FROM agg_bad;  

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6c8f670323d22acb62104f7f8f1b1a078dadd255

file_fdw: Add REJECT_LIMIT option to file_fdw.  
author	Fujii Masao <fujii@postgresql.org>	  
Wed, 20 Nov 2024 14:53:19 +0000 (23:53 +0900)  
committer	Fujii Masao <fujii@postgresql.org>	  
Wed, 20 Nov 2024 14:53:19 +0000 (23:53 +0900)  
commit	6c8f670323d22acb62104f7f8f1b1a078dadd255  
tree	ce0ab487df79a15784a9e07a85e621a78725f1bc	tree  
parent	15afb7d61c142a9254a6612c6774aff4f358fb69	commit | diff  
file_fdw: Add REJECT_LIMIT option to file_fdw.  
  
Commit 4ac2a9bece introduced the REJECT_LIMIT option for the COPY  
command. This commit extends the support for this option to file_fdw.  
  
As well as REJECT_LIMIT option for COPY, this option limits  
the maximum number of erroneous rows that can be skipped.  
If the number of data type conversion errors exceeds this limit,  
accessing the file_fdw foreign table will fail with an error,  
even when on_error = 'ignore' is specified.  
  
Since the CREATE/ALTER FOREIGN TABLE commands require foreign  
table options to be single-quoted, this commit updates  
defGetCopyRejectLimitOption() to handle also string value for them,  
in addition to int64 value for COPY command option.  
  
Author: Atsushi Torikoshi  
Reviewed-by: Fujii Masao, Yugo Nagata, Kirill Reshke  
Discussion: https://postgr.es/m/bab68a9fc502b12693f0755b6f35f327@oss.nttdata.com  

期望 PostgreSQL|开源PolarDB 增加什么功能?

PolarDB 开源数据库

PolarDB 学习图谱

PostgreSQL 解决方案集合

德哥 / digoal’s Github - 公益是一辈子的事.

About 德哥

digoal's wechat

文章转载自铃木园子,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论