truncate table restart identity for non-owner

From: Bastien Bodart <bastien(dot)bodart(at)esnah(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: truncate table restart identity for non-owner
Date: 2016-10-17 15:04:55
Message-ID: 50dd5534-05aa-20c5-06a8-188654132009@esnah.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

It's currently impossible for a non-owner user to do 'TRUNCATE table
RESTART IDENTITY;' even with ALL privileges on both the table and the
sequences because of the implied ALTER SEQUENCE RESTART operation.

Why does it work that way instead of using 'SELECT setval('foo', 1,
false);' which is equivalent and allowed for users with UPDATE privilege?

Bastien

Browse pgsql-general by date

  From Date Subject
Next Message said assemlal 2016-10-17 15:40:05 Generic way to test input arguments
Previous Message Vinicius Segalin 2016-10-16 22:30:03 Re: Query generator