1

I’ve just started with a web host which supports PostgreSQL.

When setting up a database user, I have the choice of the following privileges:

■ ALTER ■ CREATE ■ DELETE
■ EXECUTE ■ DROP ■ EVENT
■ INDEX ■ INSERT SELECT
■ TRIGGER ■ UPDATE

That doesn’t include TRUNCATE, though it does include more drastic privileges. I plan to include the DELETE,EXECUTE,INSERT,SELECT,UPDATE privileges, but what’s needed to permit TRUNCATE without giving too much away?

1 Answer 1

4

You need to have the TRUNCATE privilege to truncate a table (or be a superuser).

Since PostgreSQL has no INDEX, EVENT, ALTER or DROP privileges, I suspect that you are using a different software.

2
  • I think you’re right. The DBMS is definitely PostgreSQL, as I can connect to it and the code runs properly. However their web interface to the user info appears to be incorrect, presumably set for MySQL. I have lodged a support request with them, and they acknowledge that it’s wrong. I’ll get back.
    – Manngo
    Commented Jun 19, 2023 at 1:02
  • 1
    @Manngo could you include the name of the interface in the tags/question? Also if the support request is public (e.g. git-issue) it be also worth including.
    – A-Tech
    Commented Jun 19, 2023 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.