Re: Case sensitive grant statements in pg14?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> wrote:
richard coleman <rcoleman.ascentgl@xxxxxxxxx> 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

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux