Re: Case sensitive grant statements in pg14? - Mailing list pgsql-admin

From richard coleman
Subject Re: Case sensitive grant statements in pg14?
Date
Msg-id CAGA3vBvWwg21=YawST0AA5-_Gd-niCMnxrORN7=Pj_-nT_MP+Q@mail.gmail.com
Whole thread Raw
In response to Re: Case sensitive grant statements in pg14?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Case sensitive grant statements in pg14?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
Tom, 

The items in { } are just placeholders for actual values.  If the schema name was my_schema and the role name was bob, I could have written instead:
grant create, usage on schema my_schema to bob;

but I had thought that using {schema_name} and {role} as place holders for any valid schema and any valid role would be more concise.
It appears that I was mistaken.

I am having instances of (substituting example names for schema and role):
 grant create, usage on schema my_schema to bob;

returning the error message:
ERROR: syntax error at or near "bob"

but:
GRANT CREATE, USAGE ON SCHEMA my_schema TO bob;

succeeding.

I hope that's clearer.

rik.


On Thu, Dec 21, 2023 at 1:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
richard coleman <rcoleman.ascentgl@gmail.com> writes:
> grant create, usage on schema {schema_name} to {role};

> fails with the error:
> ERROR: syntax error at or near "{role}"

> but by changing the capitalization of the statement to:
> GRANT CREATE, USAGE ON SCHEMA {schema_name} TO {role};

> completes successfully.

What are you expecting will replace "{role}" with something
valid?  Whatever that is is apparently somehow dependent
on the context being upper-case.

                        regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Case sensitive grant statements in pg14?
Next
From: "Wetmore, Matthew (CTR)"
Date:
Subject: Error: Package: postgresql13-devel-13.13-1PGDG.rhel7.x86_64