Search Postgresql Archives

Re: How to execute 'set session role' from plpgsql function?

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

 



"Albe Laurenz" <laurenz.albe@xxxxxxxxxx> writes:
>    EXECUTE 'SET SESSION ROLE "' || lower(regexp_replace(wishedrole, '"', '', 'g')) || '"';

> The "lower" and "regexp_replace" are there to prevent SQL injection.

quote_ident() would be a far better solution.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux