Code Monkey home page Code Monkey logo

Comments (5)

pawurb avatar pawurb commented on August 17, 2024

Hi. pg_subscription.subconninfo column is not used by any of the gem queries. Also I've used this gem with multiple RDS database and never seen this error.

Can you rerun the raw SQL query from https://github.com/pawurb/ruby-pg-extras/blob/main/lib/ruby_pg_extras/queries/null_indexes.sql (you have to substitute %{min_relation_size_mb}) and check if the problem persists? I think it could be related to your AR connection setup.

from ruby-pg-extras.

gstokkink avatar gstokkink commented on August 17, 2024

Did any of those RDS databases have logical replication enabled? We're running PostgreSQL version 16.3R2 on RDS, by the way.

I already ran the raw SQL query, same error. I also managed to reproduce the issue with the following, more limited, query:

SELECT *
FROM
    pg_class c
    JOIN pg_index i ON i.indexrelid = c.oid
    JOIN pg_attribute a ON a.attrelid = c.oid
    JOIN pg_class c_table ON c_table.oid = i.indrelid
    LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname;

ERROR: permission denied for attribute pg_subscription.subconninfo

Note that if I leave out the LEFT JOIN pg_stats s ON s.tablename = c_table.relname AND a.attname = s.attname; bit, it works fine. Apparently sensitive information may be stored in the pg_stats catalog for that column.

from ruby-pg-extras.

pawurb avatar pawurb commented on August 17, 2024

@gstokkink I don't think I've used it with logical replication only read replicas. I don't know how to resolve this issue, and currently don't have time to reproduce and debug it. I'm open to any PRs that would fix it.

Maybe a workaround for you is to run this query on a read replica which does not have replication enabled?

from ruby-pg-extras.

gstokkink avatar gstokkink commented on August 17, 2024

@pawurb would it be an acceptable fix for you to explicitly leave out system catalogs in the various queries? This can be done, for example, by ignoring all namespaces that start with pg_. See https://www.postgresql.org/docs/current/catalogs.html for more details. I don't think people are particularly interested in the indexes that PG maintains itself on the system catalogs.

from ruby-pg-extras.

pawurb avatar pawurb commented on August 17, 2024

I'm not sure I understand, how filtering out the indexes would resolve this issue? Can you provide a sample PR? Also is only null_indexes not working with your current setup or other queries as well?

from ruby-pg-extras.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.