{"Entry":{"collection":"func","key":"pg-read-file","name":"pg_read_file","aliases":[],"metadata":{"changed_in":["9.1","9.5","16"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":false,"from":"9.0","group_changed":null,"signatures":{"added":["pg_read_file ( filename text [, offset bigint, length bigint] ) → text"],"removed":["pg_read_file ( filename text, offset bigint, length bigint ) → text"]},"status":"changed","to":"9.1"},{"descriptions_changed":false,"doc_overhaul":false,"from":"9.4","group_changed":null,"signatures":{"added":["pg_read_file ( filename text [, offset bigint, length bigint [, missing_ok boolean] ] ) → text"],"removed":["pg_read_file ( filename text [, offset bigint, length bigint] ) → text"]},"status":"changed","to":"9.5"},{"descriptions_changed":true,"doc_overhaul":false,"from":"10","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"11"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":false,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":["pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text"],"removed":["pg_read_file ( filename text [, offset bigint, length bigint [, missing_ok boolean ]] ) → text"]},"status":"changed","to":"16"}],"content_hash":"55e2b14df7bb733bc2fe54a95f7d619dd48832f9ccad0b222857def0993f484f","first_version":"8.1","group":"admin","group_label":"System Administration Functions","groups":["admin"],"imported_at":"2026-09-27T17:57:29.608163+08:00","last_version":"20","name":"pg_read_file","name_key":"pg_read_file","position":29075,"present_in":["8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text","signature_count":1,"slug":"pg-read-file","source_rev":"b7bd9cda","summary":"Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first).","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-read-file","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-read-file","SourceRevision":"b7bd9cda","Facts":{"description":"Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. If offset and length are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_html":"Returns all or part of a text file, starting at the given byte \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e, returning at most \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e bytes (less if the end of file is reached first). If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e is negative, it is relative to the end of the file. If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e and \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-ADMIN-GENFILE-TABLE","file":"functions-admin.html","slug":"18"},"group":"admin","group_label":"System Administration Functions","lang":"en","layout":"table-new","pages":["functions-admin.html"],"prose_only":false,"signatures":[{"description":"Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. If offset and length are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_html":"Returns all or part of a text file, starting at the given byte \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e, returning at most \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e bytes (less if the end of file is reached first). If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e is negative, it is relative to the end of the file. If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e and \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_read_file\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e\u003c/span\u003e ] [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003emissing_ok\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ADMIN-GENFILE-TABLE","file":"functions-admin.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-read-file","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_read_file","Summary":"返回一个文本文件的全部或部分，从给定的字节offset开始，最多返回length字节（如果先到达文件末尾，则返回更少）。如果offset为负，则它相对于文件末尾计算。如果省略offset和length，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","BodyHTML":"返回一个文本文件的全部或部分，从给定的字节\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e开始，最多返回\u003cem\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e字节（如果先到达文件末尾，则返回更少）。如果\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e为负，则它相对于文件末尾计算。如果省略\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e和\u003cem\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。\u003cpre\u003epg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text\u003c/pre\u003e返回一个文本文件的全部或部分，从给定的字节\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e开始，最多返回\u003cem\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e字节（如果先到达文件末尾，则返回更少）。如果\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e为负，则它相对于文件末尾计算。如果省略\u003cem\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e和\u003cem\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","SourceRevision":"1b5ca64c","ContentHash":"49d4b34a20d73c8dbf83154061baed565b4dab6860177c0809cc5889bfec9d11","Payload":{"description_zh":"返回一个文本文件的全部或部分，从给定的字节offset开始，最多返回length字节（如果先到达文件末尾，则返回更少）。如果offset为负，则它相对于文件末尾计算。如果省略offset和length，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","description_zh_html":"返回一个文本文件的全部或部分，从给定的字节\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e开始，最多返回\u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e字节（如果先到达文件末尾，则返回更少）。如果\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e为负，则它相对于文件末尾计算。如果省略\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e和\u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","signatures":[{"description_zh":"返回一个文本文件的全部或部分，从给定的字节offset开始，最多返回length字节（如果先到达文件末尾，则返回更少）。如果offset为负，则它相对于文件末尾计算。如果省略offset和length，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","description_zh_html":"返回一个文本文件的全部或部分，从给定的字节\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e开始，最多返回\u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e字节（如果先到达文件末尾，则返回更少）。如果\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e为负，则它相对于文件末尾计算。如果省略\u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e和\u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e，则返回整个文件。从文件中读取的字节会按数据库编码解释为字符串；如果它们在该编码下无效，则会抛出错误。","returns":"text","text":"pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"99408f48677127f606724f912b5768be0f9945011be657631330d8f0e5604b41","Text":"pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text","Returns":"text","Payload":{"description":"Returns all or part of a text file, starting at the given byte offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. If offset and length are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_html":"Returns all or part of a text file, starting at the given byte \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e, returning at most \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e bytes (less if the end of file is reached first). If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e is negative, it is relative to the end of the file. If \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e and \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the database's encoding; an error is thrown if they are not valid in that encoding.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_read_file\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eoffset\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elength\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e\u003c/span\u003e ] [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003emissing_ok\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_read_file ( filename text [, offset bigint, length bigint ] [, missing_ok boolean ] ) → text","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
