Skip to content
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

Синтаксическая ошибка в плагине archive_command.py #197

Open
sgrinko opened this issue Nov 30, 2022 · 2 comments
Assignees
Labels
Milestone

Comments

@sgrinko
Copy link
Contributor

sgrinko commented Nov 30, 2022

В коде плагина пропущена фраза SELECT:

    query_agent_size_files = """
    WITH values AS (
    SELECT
    4096/(ceil(pg_settings.setting::numeric/1024/1024)) AS segment_parts_count,
    setting::bigint AS segment_size,
    ('x' || substring(pg_stat_archiver.last_archived_wal from 9 for 8))::bit(32)::int AS last_wal_div,
    ('x' || substring(pg_stat_archiver.last_archived_wal from 17 for 8))::bit(32)::int AS last_wal_mod,
    CASE WHEN pg_is_in_recovery() THEN NULL ELSE
    ('x' || substring(pg_{1}_name(pg_current_{0}()) from 9 for 8))::bit(32)::int END AS current_wal_div,
    CASE WHEN pg_is_in_recovery() THEN NULL ELSE
    ('x' || substring(pg_{1}_name(pg_current_{0}()) from 17 for 8))::bit(32)::int END AS current_wal_mod
    FROM pg_settings, pg_stat_archiver
    WHERE pg_settings.name = 'wal_segment_size')
    greatest(coalesce(((segment_parts_count - last_wal_mod) + ((current_wal_div - last_wal_div - 1) * segment_parts_count) + current_wal_mod - 1) * segment_size, 0), 0)::bigint AS size_files
    FROM values;
    """

greatest(coalesce(((segment_parts_count - last_wal_mod) + ((current_wal_div - last_wal_div - 1) * segment_parts_count) + current_wal_mod - 1) * segment_size, 0), 0)::bigint AS size_files

@cuprumtan cuprumtan self-assigned this Jan 23, 2023
@cuprumtan cuprumtan modified the milestones: next, 3.5.3 Jan 23, 2023
@cuprumtan cuprumtan added the bug label Jan 23, 2023
@cuprumtan
Copy link
Contributor

Добрый день! Поправили запрос в последнем релизе.

@sgrinko
Copy link
Contributor Author

sgrinko commented Jun 29, 2023

Спасибо, можно закрыть

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants