Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: using 'ALTER ROLE' in a function


  • From: Douglas McNaught <doug(at)mcnaught(dot)org>
  • To: Lutz Broedel <lb(at)fggm(dot)uni-hannover(dot)de>
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: using 'ALTER ROLE' in a function
  • Date: Thu, 22 Mar 2007 11:33:18 -0400
  • Message-id: <878xdpz41t(dot)fsf(at)suzuka(dot)mcnaught(dot)org>

Lutz Broedel <lb(at)fggm(dot)uni-hannover(dot)de> writes:

> ERROR:  Error »syntax error« at »$1« at character 13
> QUERY:  ALTER ROLE  $1  WITH ENCRYPTED PASSWORD  $2
>
> I have tried this in several ways and it seems, ALTER ROLE just does
> not accept a parameter instead of name. Does anybody have a solution
> for this?

You probably need to build the query dynamically and use EXECUTE.

-Doug



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group