Skip to content

Commit 682d473

Browse files
authored
Support PG18beta1. (#298)
1 parent ab3b4ac commit 682d473

File tree

3 files changed

+49
-12
lines changed

3 files changed

+49
-12
lines changed

include/compatibility.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,37 @@ CastCreate(Oid sourcetypeid, Oid targettypeid, Oid funcid, char castcontext,
459459
typeCollation)
460460
#endif
461461

462-
#if PG_VERSION_NUM >= 140000
462+
#if PG_VERSION_NUM >= 180000
463+
#define PROCEDURE_CREATE(procedureName, procNamespace, replace, returnsSet, returnType, proowner, languageObjectId, languageValidator, prosrc, probin, prokind, security_definer, isLeakProof, isStrict, volatility, parallel, parameterTypes, allParameterTypes, parameterModes, parameterNames, parameterDefaults, trftypes, proconfig, procost, prorows) \
464+
ProcedureCreate(procedureName, \
465+
procNamespace, \
466+
replace, \
467+
returnsSet, \
468+
returnType, \
469+
proowner, \
470+
languageObjectId, \
471+
languageValidator, \
472+
prosrc, \
473+
probin, \
474+
NULL, /* prosqlbody */ \
475+
prokind, \
476+
security_definer, \
477+
isLeakProof, \
478+
isStrict, \
479+
volatility, \
480+
parallel, \
481+
parameterTypes, \
482+
allParameterTypes, \
483+
parameterModes, \
484+
parameterNames, \
485+
parameterDefaults, \
486+
trftypes, \
487+
NIL, /* trfoids */ \
488+
proconfig, \
489+
InvalidOid, /* prosupport */ \
490+
procost, \
491+
prorows)
492+
#elif PG_VERSION_NUM >= 140000
463493
#define PROCEDURE_CREATE(procedureName, procNamespace, replace, returnsSet, returnType, proowner, languageObjectId, languageValidator, prosrc, probin, prokind, security_definer, isLeakProof, isStrict, volatility, parallel, parameterTypes, allParameterTypes, parameterModes, parameterNames, parameterDefaults, trftypes, proconfig, procost, prorows) \
464494
ProcedureCreate(procedureName, \
465495
procNamespace, \

test/expected/pg_tle_extension_schema.out

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,19 @@ SELECT * from pgtle.available_extension_versions() ORDER BY name;
251251
my_tle_4 | 1.0 | f | f | f | my_tle_schema_2 | {my_tle_3,pg_tle} | My TLE
252252
(4 rows)
253253

254-
\dx
255-
List of installed extensions
256-
Name | Version | Schema | Description
257-
----------+---------+-----------------+--------------------------------------------
258-
my_tle_1 | 1.0 | public | My TLE
259-
my_tle_2 | 1.0 | public | My TLE
260-
my_tle_3 | 1.0 | my_tle_schema_1 | My TLE
261-
my_tle_4 | 1.0 | my_tle_schema_2 | My TLE
262-
pg_tle | 1.5.0 | pgtle | Trusted Language Extensions for PostgreSQL
263-
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
254+
SELECT e.extname, n.nspname, e.extrelocatable, e.extversion
255+
FROM pg_extension e
256+
INNER JOIN pg_namespace n
257+
ON e.extnamespace = n.oid
258+
ORDER BY extname ASC;
259+
extname | nspname | extrelocatable | extversion
260+
----------+-----------------+----------------+------------
261+
my_tle_1 | public | f | 1.0
262+
my_tle_2 | public | f | 1.0
263+
my_tle_3 | my_tle_schema_1 | f | 1.0
264+
my_tle_4 | my_tle_schema_2 | f | 1.0
265+
pg_tle | pgtle | f | 1.5.0
266+
plpgsql | pg_catalog | f | 1.0
264267
(6 rows)
265268

266269
-- Clean up. Drop the SQL and control functions explicitly to make sure the

test/sql/pg_tle_extension_schema.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ CREATE EXTENSION my_tle_4;
156156
-- Validate the output of these functions.
157157
SELECT * FROM pgtle.available_extensions() ORDER BY name;
158158
SELECT * from pgtle.available_extension_versions() ORDER BY name;
159-
\dx
159+
SELECT e.extname, n.nspname, e.extrelocatable, e.extversion
160+
FROM pg_extension e
161+
INNER JOIN pg_namespace n
162+
ON e.extnamespace = n.oid
163+
ORDER BY extname ASC;
160164

161165
-- Clean up. Drop the SQL and control functions explicitly to make sure the
162166
-- drops happen in the expected order and avoid random errors.

0 commit comments

Comments
 (0)