Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransferOwnership ¶
TransferOwnership runs ALTER TABLE <table> OWNER TO CURRENT_USER as an idempotent fail-soft op.
Best-effort: if the connected role is not the current table owner (common after a restore where a superuser created the tables), the ALTER fails with SQLSTATE 42501 (insufficient_privilege) and we log a warning instead of returning an error. All other errors are also logged as warnings and swallowed — ownership transfer is advisory; callers must rely on explicit DML grants as the hard guarantee.
logPrefix is prepended to log messages (e.g. "codegraph", "embeddings") so log lines stay attributable to the calling subsystem.
The SQL keyword CURRENT_USER is a Postgres built-in, not a bind parameter, so it resolves to the connected role regardless of the DATABASE_URL role name.
NOTE: The string "CURRENT_USER" must appear in the generated SQL — tests assert this to prevent accidental hardcoding of a role name.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pgtest holds shared test-only helpers for pgvector store integration tests (analogous in spirit to stdlib's net/http/httptest: a dedicated test-support package, never imported by production code).
|
Package pgtest holds shared test-only helpers for pgvector store integration tests (analogous in spirit to stdlib's net/http/httptest: a dedicated test-support package, never imported by production code). |