PG Bug reporting form <noreply@postgresql.org> writes:
> When a user without SELECT permissions tries to perform a select operation
> on a circular view, PostgreSQL will report an error saying "infinite
> recursion detected in rules for relation v2" instead of "permission denied
> for view v2". Is this a bug or an unexpected behavior?
[ shrug... ] Neither, I'd say. There are no specific restrictions on
the order in which error checks are performed.
> Regardless, a circular view is an invalid view and should not appear in
> normal scenarios, so reporting this error message does not have any negative
> impact. However, should this error take precedence over the SELECT
> permission error, and could some important error messages potentially be
> leaked in this way to users without permissions?
It's hard to see how this leaks any information that's not
readily available to everybody from the system catalogs
(ie, "\d+ v1" and "\d+ v2").
regards, tom lane