8000 Fix dbmirror2 replication init, function search_path (fixes #6) by sfussenegger · Pull Request #8 · acoustid/mbslave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix dbmirror2 replication init, function search_path (fixes #6) #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

sfussenegger
Copy link
Contributor
  • add dbmirror2 schema
  • init replication
  • explicitly set search_path on function creation

These changes seem to have fixed the problem for me.

@nikammerlaan
Copy link
nikammerlaan commented Jun 8, 2024

Are there any updates on getting this PR merged? Would love to see syncing functional again.

@lalinsky lalinsky merged commit cfdd439 into acoustid:main Aug 22, 2024
frisi pushed a commit to molindo/mbslave that referenced this pull request May 26, 2025
note that this reverts the adaptions done by acoustid#8

as musicbrainz does not ship the scripts with function definitions
containing a `SET schema` local adaptions would always lead to merge
problems.

if users have problems that functions do not use the correct schema for
queries and can't find functions or tables, consider to set the schema on session,
user or database level:

```
-- session
SET search_path to musicbrainz,public;

-- user level
ALTER USER musicbrainz SET search_path TO musicbrainz, public;

-- check user level settings via psql
\drds mbdata;

-- check user level via query
SELECT
    r.rolname AS role_name,
    rs.setconfig AS configured_settings
FROM
    pg_roles r
LEFT JOIN
    pg_db_role_setting rs ON r.oid = rs.setrole
WHERE
    r.rolname = 'musicbrainz';

-- db level
SELECT setting FROM pg_settings WHERE name = 'search_path';
ALTER DATABASE database_name SET search_path TO musicbrainz, public;
```
frisi pushed a commit to molindo/mbslave that referenced this pull request May 26, 2025
note that this reverts the adaptions done by acoustid#8

as musicbrainz does not ship the scripts with function definitions
containing a `SET schema` local adaptions would always lead to merge
problems.

if users have problems that functions do not use the correct schema for
queries and can't find functions or tables, consider to set the schema on session,
user or database level:

```
-- session
SET search_path to musicbrainz,public;

-- user level
ALTER USER musicbrainz SET search_path TO musicbrainz, public;

-- check user level settings via psql
\drds mbdata;

-- check user level via query
SELECT
    r.rolname AS role_name,
    rs.setconfig AS configured_settings
FROM
    pg_roles r
LEFT JOIN
    pg_db_role_setting rs ON r.oid = rs.setrole
WHERE
    r.rolname = 'musicbrainz';

-- db level
SELECT setting FROM pg_settings WHERE name = 'search_path';
ALTER DATABASE database_name SET search_path TO musicbrainz, public;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0