Repository navigation
PostgreSQL: detect FreshRSS tables by visibility rather than owner - #9535
Merged
Merged
Conversation
…e tables For as long as the install check has existed, it asked pg_tables who owned the tables and compared that against the database login. Nobody asked why. The login is a gateway user, the tables belong to whatever role ran the install, and whenever those two names diverged the check reported the schema as missing. Visibility was the question all along. tablesAreCorrect() now asks pg_class which ordinary and partitioned tables are visible on the search_path. If PostgreSQL can see it, it counts. A table parked in a schema outside the path does not hide a missing one, and a view named like a table is not a table. The new test builds a role, a visible schema, a hidden schema, and a view with a suspicious name, then checks that each answer is the true one. It runs against a real PostgreSQL 18 service in CI. Locally it skips unless FRESHRSS_TEST_PGSQL_DSN is set.
quinnypig
force-pushed
the
fix/pgsql-installation-check
branch
from
November 5, 2026 22:04
7d61b9d to
070bf34
Compare
quinnypig
marked this pull request as ready for review
November 5, 2026 22:05
For the record: nobody announced it. The postgres:18-alpine tag sat in tests.yml like a loaded gun pointed at every CI run, and zizmor was the first thing to notice it had no fixed identity at all. Remember the Denver Airport. Remember that tags are not promises. This commit replaces the mutable tag with the exact multi-arch digest the suite was already tested against: postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36 This is not a version bump. Same image, same PostgreSQL 18, same Alpine base. The only thing that changed is that the image can no longer be swapped out from under us between Tuesday's green run and Thursday's mystery failure. Verification: all pre-commit PHP, test, JS, CSS and Markdown checks pass. Local pedantic offline zizmor reports no findings. This resolves the unpinned-service-image blocker on PR FreshRSS#9535.
Alkarex
approved these changes
Nov 14, 2026
Member
|
Thanks! |
Contributor
Author
|
Looks good to me; thanks @Alkarex. |
Member
Alkarex
added a commit
that referenced
this pull request
Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On PostgreSQL, the install check could report the connection as working and all six per-table checks as passing while the overall “tables” check failed.
FreshRSS_DatabaseDAOPGSQL::tablesAreCorrect()listed tables frompg_tablesfiltered ontableowner = <configured db user>. That assumption breaks when a connection gateway's login name differs from the PostgreSQL role, or when the application has been granted access to tables owned by another role.The method now enumerates base and partitioned tables from
pg_classthat are visible in the session's activesearch_path, matching the DAO's unqualified queries. Views and foreign tables remain excluded. Tables outsidesearch_pathare now correctly reported as missing.Added a PostgreSQL integration test covering tables owned by another role, a table outside
search_path, and a view with the expected table name. The tests workflow provides PostgreSQL; local runs skip this test unlessFRESHRSS_TEST_PGSQL_DSNis configured. All test objects are rolled back.Validation on PHP 8.5.12 and PostgreSQL 18.6:
composer testpasses: 845 tests, 1,763 assertions, PHP/PHTML lint, PHPCS and PHPStan.npm testpasses: JavaScript, CSS and Markdown checks.