-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
pgmq migration safety #1380
pgmq migration safety #1380
Conversation
n.nspname = 'pgmq' | ||
and c.relname like 'q_%' | ||
and c.relkind in ('r', 'p', 'u') | ||
on conflict (queue_name) do nothing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idempotence
and ( | ||
select array_agg(attname::text order by attname) | ||
from pg_catalog.pg_attribute a | ||
where | ||
a.attnum > 0 | ||
and a.attrelid = c.oid | ||
) = array['created_at', 'is_partitioned', 'is_unlogged', 'queue_name']::text[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate column names match the expected list
where | ||
n.nspname = 'pgmq' | ||
and c.relname = 'meta' | ||
and c.relkind = 'r' -- regular table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirm its a regular table
pgmq
migration to ensure idempotency with on-conflict clause