Transaction prevention

From: Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Transaction prevention
Date: 2020-07-29 23:56:35
Message-ID: CAKE1AiYUreZcQdgg76DK2ESAxuowf4OkLhUJyfVXc2or4Y25Vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

If I have a user that is restricted to select access (only) on a single
table, is there any way to prevent that user from starting a transaction?

The reason for the question is that the select-only user can block another
session trying to run an alter table on that table if the select-only
user runs their query in a transaction.

This happened to us recently where a migration script that was being run
during a ci deployment 'hung' until the select-only user happened to
disconnect. I'm wondering if we need to terminate any sessions from
select-only users at the start of the migration, or if there is a better
way.

Thanks,

Steve

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-07-30 00:23:34 Re: Transaction prevention
Previous Message Adrian Klaver 2020-07-29 17:58:09 Re: Track pgsql steps