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

Is it possible to use pg_background to perform REINDEX INDEX CONCURRENTLY? #64

Open
ignalexeyp opened this issue Dec 4, 2024 · 0 comments

Comments

@ignalexeyp
Copy link

Calling the command
SELECT * FROM pg_background_result(pg_background_launch('REINDEX INDEX CONCURRENTLY public.pgbench_branches_pkey')) AS (result text);
causes it to hang.

The lock analysis revealed

pid blocked_by state wait wait_age tx_age usename datname blkd query
3 215 028 {} active IPC:MessageQueueReceive 00:10:32 postgres test12072024 1 [3215028] SELECT * FROM pg_background_result(pg_background_launch('REINDEX INDEX CONCURRENTLY public.pgbench_branches_pkey')) AS (result text)
3 219 682 {3 215 028} waiting Lock:virtualxid 00:10:32 00:10:32 postgres test12072024 0 [3219682] . REINDEX INDEX CONCURRENTLY public.pgbench_branches_pkey

Is it possible to use pg_background to perform REINDEX INDEX CONCURRENTLY?

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

No branches or pull requests

1 participant