apache / apache/age

CREATE EXTENSION pg_stat_statements fails when AGE 1.5.0 is in shared_preload_libraries

Open
#2,180 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Hi.

When Apache AGE (version 1.5.0) is included in shared_preload_libraries and its extension is created in a dedicated database (e.g., service_db, creating the ag_catalog schema there), attempting to run CREATE EXTENSION pg_stat_statements; in a different database (e.g., the default postgres database) fails with:
ERROR: 3F000: schema "ag_catalog" does not exist; LOCATION: get_namespace_oid, namespace.c:3098.

This occurs on PostgreSQL 15.12. The pg_stat_statements extension itself has no dependency on ag_catalog. The issue seems to stem from an attempted lookup of ag_catalog within the context of the postgres database, where it doesn't exist.

Environment:

PostgreSQL Version: 15.12
Apache AGE Version: 1.5.0

Suspected Cause:

The globally preloaded AGE library components (due to shared_preload_libraries) appear to interfere with DDL commands in other databases. It's suspected that an AGE global hook or process attempts to reference ag_catalog without correctly checking the current database context, leading to the failure when CREATE EXTENSION pg_stat_statements is executed in a database lacking ag_catalog.

Request:
We request the Apache AGE development team to investigate this potential issue where AGE's presence in shared_preload_libraries might cause interference with standard extension DDL in other databases by incorrectly attempting to access its specific ag_catalog schema.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.