Re: Row security violation error is misleading

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Row security violation error is misleading
Date: 2015-04-08 15:02:03
Message-ID: 20150408150203.GQ3663@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Kevin Grittner (kgrittn(at)ymail(dot)com) wrote:
> Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>
> >> Re-using the SQLSTATE 44000 is a bit iffy too. We should
> >> probably define something to differentiate this, like:
> >>
> >> 44P01 ROW SECURITY WRITE POLICY VIOLATION
> >
> > Yes, that sounds sensible.
>
> I would be more inclined to use:
>
> 42501 ERRCODE_INSUFFICIENT_PRIVILEGE
>
> I know this is used 173 other places where a user attempts to do
> something they are not authorized to do, so you would not be able
> to differentiate the specific cause based on SQLSTATE if this is
> used -- but why don't we feel that way about the other 173 causes?
> Why does this security violation require a separate SQLSTATE?

I tend to agree with this and it feels more consistent. SQLSTATE is
already a very generic response system and knowing that it's a policy
violation instead of a GRANT violations strikes me as unlikely to be
terribly interesting at the level where you're just looking at the
SQLSTATE code.

Thanks!

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-04-08 15:27:00 Re: Row security violation error is misleading
Previous Message Tom Lane 2015-04-08 14:57:43 Re: Support UPDATE table SET(*)=...