uesleilima opened a new pull request, #2366:
URL: https://github.com/apache/age/pull/2366
Fixes #2353
### Problem
`setUpAge()` and `Age.connect()` unconditionally execute `LOAD 'age'` (or
`LOAD '$libdir/plugins/age'`). On managed PostgreSQL services like Azure
Database for PostgreSQL, the AGE extension is loaded server-side via
`shared_preload_libraries` and the binary is not accessible at the file path
expected by `LOAD`, causing a `psycopg.errors.UndefinedFile` error. There is no
way to use the driver in these environments without bypassing the setup
entirely.
### Solution
Add a `skip_load` parameter (default `False`) to `setUpAge()`,
`Age.connect()`, and the module-level `age.connect()`. When `True`, the `LOAD`
statement is skipped while all other setup is preserved:
- `SET search_path`
- agtype adapter registration
- graph existence check / creation
This is fully backward-compatible — existing code is unaffected.
### Usage
```python
import age
ag = age.connect(
dsn="host=myserver.postgres.database.azure.com ...",
graph="my_graph",
skip_load=True
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]