{"Entry":{"collection":"catalog","key":"pg_prepared_statements","name":"pg_prepared_statements","aliases":[],"metadata":{"changed_in":["14","16"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"8.1","order":false,"removed":[],"status":"added","to":"8.2","types":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"The expected parameter types for the prepared statement in the form of an array of regtype. The OID corresponding to an element of this array can be obtained by casting the regtype value to oid","name":"parameter_types","to":"The expected parameter types for the prepared statement in the form of an array of regtype. The OID corresponding to an element of this array can be obtained by casting the regtype value to oid."},{"from":"The query string submitted by the client to create this prepared statement. For prepared statements created via SQL, this is the PREPARE statement submitted by the client. For prepared statements created via the frontend/backend protocol, this is the text of the prepared statement itself","name":"statement","to":"The query string submitted by the client to create this prepared statement. For prepared statements created via SQL, this is the PREPARE statement submitted by the client. For prepared statements created via the frontend/backend protocol, this is the text of the prepared statement itself."}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"true if the prepared statement was created via the PREPARE SQL statement; false if the statement was prepared via the frontend/backend protocol","name":"from_sql","to":"true if the prepared statement was created via the PREPARE SQL command; false if the statement was prepared via the frontend/backend protocol"}],"from":"9.5","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.6","types":[],"unlisted":[]},{"added":["generic_plans","custom_plans"],"attributes":[],"description_changed":false,"descriptions":[],"from":"13","listing":[],"order":false,"removed":[],"status":"changed","to":"14","types":[],"unlisted":[]},{"added":["result_types"],"attributes":[],"description_changed":false,"descriptions":[],"from":"15","listing":[],"order":false,"removed":[],"status":"changed","to":"16","types":[],"unlisted":[]}],"column_count":8,"content_hash":"c180688b335fde1bff470ce3946eb4045a0a17f3810b24b1bdd2437c90ee37a0","first_version":"8.2","imported_at":"2026-09-30T00:40:55.689135+08:00","kind":"view","last_version":"20","name":"pg_prepared_statements","position":55,"present_in":["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"],"relation_oid":null,"relkind":"v","shared":false,"source_rev":"english-manuals:69fd607b4994c39904e9e829e442ce27f3db82af405fdb1903ff9856c0084e2d","summary":"The pg_prepared_statements view displays all the prepared statements that are available in the current session.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_prepared_statements","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_prepared_statements","SourceRevision":"english-manuals:69fd607b4994c39904e9e829e442ce27f3db82af405fdb1903ff9856c0084e2d","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"The identifier of the prepared statement","description_zh":"","documented":true,"documented_name":"name","hidden":false,"name":"name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":2,"description":"The query string submitted by the client to create this prepared statement. For prepared statements created via SQL, this is the PREPARE statement submitted by the client. For prepared statements created via the frontend/backend protocol, this is the text of the prepared statement itself.","description_zh":"","documented":true,"documented_name":"statement","hidden":false,"name":"statement","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":3,"description":"The time at which the prepared statement was created","description_zh":"","documented":true,"documented_name":"prepare_time","hidden":false,"name":"prepare_time","not_null":false,"references":"","type":"timestamptz","type_modifier":-1,"type_oid":1184},{"array_dimensions":0,"attnum":4,"description":"The expected parameter types for the prepared statement in the form of an array of regtype. The OID corresponding to an element of this array can be obtained by casting the regtype value to oid.","description_zh":"","documented":true,"documented_name":"parameter_types","hidden":false,"name":"parameter_types","not_null":false,"references":"","type":"regtype[]","type_modifier":-1,"type_oid":2211},{"array_dimensions":0,"attnum":5,"description":"The types of the columns returned by the prepared statement in the form of an array of regtype. The OID corresponding to an element of this array can be obtained by casting the regtype value to oid. If the prepared statement does not provide a result (e.g., a DML statement), then this field will be null.","description_zh":"","documented":true,"documented_name":"result_types","hidden":false,"name":"result_types","not_null":false,"references":"","type":"regtype[]","type_modifier":-1,"type_oid":2211},{"array_dimensions":0,"attnum":6,"description":"true if the prepared statement was created via the PREPARE SQL command; false if the statement was prepared via the frontend/backend protocol","description_zh":"","documented":true,"documented_name":"from_sql","hidden":false,"name":"from_sql","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":7,"description":"Number of times generic plan was chosen","description_zh":"","documented":true,"documented_name":"generic_plans","hidden":false,"name":"generic_plans","not_null":false,"references":"","type":"int8","type_modifier":-1,"type_oid":20},{"array_dimensions":0,"attnum":8,"description":"Number of times custom plan was chosen","description_zh":"","documented":true,"documented_name":"custom_plans","hidden":false,"name":"custom_plans","not_null":false,"references":"","type":"int8","type_modifier":-1,"type_oid":20}],"description":"The pg_prepared_statements view displays all the prepared statements that are available in the current session. See PREPARE for more information about prepared statements.\n\npg_prepared_statements contains one row for each prepared statement. Rows are added to the view when a new prepared statement is created and removed when a prepared statement is released (for example, via the DEALLOCATE command).","description_zh":"","doc":{"anchor":"id-1.10.5.20.5","file":"view-pg-prepared-statements.html","lang":"en","sha256":"b1d9d49cb94c74e040c64f33db856bd6cd7d3cefe11227ad8fd84ffcf2aaa56b","slug":"18"},"kind":"view","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["name","statement","prepare_time","parameter_types","result_types","from_sql","generic_plans","custom_plans"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.5.20.5","file":"view-pg-prepared-statements.html","lang":"en","sha256":"b1d9d49cb94c74e040c64f33db856bd6cd7d3cefe11227ad8fd84ffcf2aaa56b","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["name","statement","prepare_time","parameter_types","result_types","from_sql","generic_plans","custom_plans"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_prepared_statements","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_prepared_statements","Summary":"pg_prepared_statements 视图显示当前会话中所有可用的预备语句。关于预备语句的更多信息，参见PREPARE。\n\npg_prepared_statements 为每个预备语句包含一行。创建新的预备语句时，会向该视图添加一行；释放预备语句时（例如通过 DEALLOCATE 命令）则会移除该行。","BodyHTML":"\u003cp\u003epg_prepared_statements 视图显示当前会话中所有可用的预备语句。关于预备语句的更多信息，参见PREPARE。\n\npg_prepared_statements 为每个预备语句包含一行。创建新的预备语句时，会向该视图添加一行；释放预备语句时（例如通过 DEALLOCATE 命令）则会移除该行。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"e38e82565c2f6e443223ca640eba40df62d0baca93f2e2ab9cd9398f8068f097","Payload":{"columns":[{"description_zh":"预备语句的标识符","name":"name","type":"text","zh_from":"doc"},{"description_zh":"客户端提交用于创建此预备语句的查询字符串。对于通过SQL创建的预备语句，这里是由客户端提交的PREPARE语句。对于通过前端/后端协议创建的预备语句，这里是预备语句本身的文本。","name":"statement","type":"text","zh_from":"doc"},{"description_zh":"预备语句被创建的时间","name":"prepare_time","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"预备语句期望的参数类型，以一个regtype数组的形式。这个数组中一个元素所对应的OID可通过将regtype值转换为oid获得。","name":"parameter_types","type":"regtype[]","zh_from":"doc"},{"description_zh":"该预备语句返回列的类型，以 regtype 数组形式表示。该数组中某个元素对应的 OID 可以通过将 regtype 值转换为 oid 获得。如果预备语句不提供结果（例如 DML 语句），则该字段为 NULL。","name":"result_types","type":"regtype[]","zh_from":"doc"},{"description_zh":"如果预备语句通过SQL命令PREPARE创建，则为true；如果预备语句通过前端/后端协议创建，则为false","name":"from_sql","type":"boolean","zh_from":"doc"},{"description_zh":"通用计划被选用的次数","name":"generic_plans","type":"bigint","zh_from":"doc"},{"description_zh":"定制计划被选用的次数","name":"custom_plans","type":"bigint","zh_from":"doc"}],"description_zh":"pg_prepared_statements 视图显示当前会话中所有可用的预备语句。关于预备语句的更多信息，参见PREPARE。\n\npg_prepared_statements 为每个预备语句包含一行。创建新的预备语句时，会向该视图添加一行；释放预备语句时（例如通过 DEALLOCATE 命令）则会移除该行。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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":null,"Spellings":null,"SQLState":null,"Evidence":null}
