Error in Grant script all

Asked

Viewed 35 times

0

I have a little problem in a script that theoretically will give permission to a specific group in a postgresql database.

Follows script:

#!/bin/bash
su postgres -l -c "psql -c 'grant all on database teste_semanal to grp.teste_own;'"

What happens, when I run the script gives error at the point, a syntax error:

ERROR: syntax error on or near "." ROW 1: Grant all on database teste_weekly to group grp.test...

If I exchange the user or group for a non-stick name, test example works normal.
I wonder if anyone knows how to make this user with point be recognized.

  • No missing internal double quotes? ...to "grp.teste_own";'"

  • Not with quotes also gives the same error. It simply is not recognizing the point.

  • Try to put an scape Grant all on database teste_semanal to grp\.teste_own

  • A similar thing was resolved here in the same way as @Ismael http://stackoverflow.com/questions/2293595/postgresql-escaping-dash-in-username

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.