pgpool_regclass
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgpool | 4.7.1 | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5900 | pgpool_adm | No | No | No | Yes | No | No | - |
| 5910 | pgpool_recovery | No | No | No | Yes | No | No | - |
| 5920 | pgpool_regclass | No | No | No | Yes | No | No | - |
| Related | pg_repack pg_rewrite pg_squeeze pg_dirtyread pgfincore pg_cooldown |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 4.7.1 | 1817161514 | pgpool | - |
| RPM | PGDG | 4.7.1 | 1817161514 | pgpool-II-pg$v-extensions | - |
| DEB | PGDG | 4.7.1 | 1817161514 | postgresql-$v-pgpool2 | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| el8.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| el9.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| el9.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| el10.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| el10.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| d12.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| d12.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| d13.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| d13.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| u22.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| u22.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| u24.x86_64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
| u24.aarch64 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 | PGDG 4.7.1 |
Install
You can install pgpool directly. First, make sure the PGDG repository is added and enabled:
pig repo add pgdg -u # Add PGDG repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pgpool; # Install for current active PG version
pig ext install -y pgpool -v 18 # PG 18
pig ext install -y pgpool -v 17 # PG 17
pig ext install -y pgpool -v 16 # PG 16
pig ext install -y pgpool -v 15 # PG 15
pig ext install -y pgpool -v 14 # PG 14
dnf install -y pgpool-II-pg18-extensions # PG 18
dnf install -y pgpool-II-pg17-extensions # PG 17
dnf install -y pgpool-II-pg16-extensions # PG 16
dnf install -y pgpool-II-pg15-extensions # PG 15
dnf install -y pgpool-II-pg14-extensions # PG 14
apt install -y postgresql-18-pgpool2 # PG 18
apt install -y postgresql-17-pgpool2 # PG 17
apt install -y postgresql-16-pgpool2 # PG 16
apt install -y postgresql-15-pgpool2 # PG 15
apt install -y postgresql-14-pgpool2 # PG 14
Create Extension:
CREATE EXTENSION pgpool_regclass;
Usage
The pgpool_regclass extension provides a replacement regclass function used internally by Pgpool-II to handle relation name resolution across multiple backends.
Function
-- Resolve a relation name to its OID, similar to PostgreSQL's regclass cast
SELECT pgpool_regclass('my_table');
SELECT pgpool_regclass('my_schema.my_table');
Purpose
In standard PostgreSQL, casting a string to regclass (e.g., 'my_table'::regclass) resolves the relation name to an OID. However, Pgpool-II needs to determine whether a SQL statement references a temporary table or a regular table to route queries correctly.
The pgpool_regclass function provides this resolution capability as a regular function call rather than a type cast, allowing Pgpool-II to:
- Determine if a referenced table exists on the backend
- Distinguish temporary tables from permanent tables for proper query routing
- Handle schema-qualified table names correctly across pooled connections
Notes
- This extension is primarily used internally by Pgpool-II and is not typically called directly by applications
- It should be installed on all PostgreSQL backend nodes managed by Pgpool-II
- For Pgpool-II 3.0+, this function helps with the
check_temp_tablefeature
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.