pre_prepare
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
preprepare | 0.9 | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5170 | pre_prepare | No | Yes | No | Yes | No | Yes | - |
| Related | pg_hint_plan plan_filter pg_query_rewrite hypopg pg_qualstats index_advisor online_advisor pg_stat_plans pg_kpart pg_fsql |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 0.9 | 1817161514 | preprepare | - |
| RPM | PIGSTY | 0.9 | 1817161514 | preprepare_$v | - |
| DEB | PGDG | 0.9 | 1817161514 | postgresql-$v-preprepare | - |
Build
You can build the RPM packages for preprepare using pig build:
Install
You can install preprepare directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
pre_prepare automatically prepares SQL statements at connection time so clients can directly use EXECUTE without calling PREPARE first.
Setup
Configure in postgresql.conf:
Create a table to store statements:
Insert statements (include the full PREPARE syntax):
Functions
prepare_all() – Prepare all statements from the configured relation:
prepare_all('schema.table') – Prepare statements from a specific table:
discard() – Like DISCARD ALL but without DEALLOCATE ALL (preserves prepared statements):
With PgBouncer
Set connect_query to auto-prepare on each server connection:
Avoid using DISCARD ALL as your reset_query (it would deallocate the prepared statements).
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)