Not able to change the owner of function

Started by Jignesh Shahabout 16 years ago7 messagesgeneral
Jump to latest
#1Jignesh Shah
jignesh.shah1980@gmail.com

Hi,

could you tell me what could be the issue in below command. I could see that
there is an option for changing OWNER of function but not sure why it is
giving this error.

techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR: unrecognized configuration parameter "owner"
techdb=#

Thanks in advance,
Jack

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Jignesh Shah (#1)
Re: Not able to change the owner of function

In response to Jignesh Shah :

Hi,
�
could you tell me what could be the issue in below command. I could see that
there is an option for changing OWNER of function but not sure why it is giving
this error.
�
techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR:� unrecognized configuration parameter "owner"

test=*# \h alter function
Command: ALTER FUNCTION
Description: change the definition of a function
Syntax:
ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] )
OWNER TO new_owner

Read that and try:

ALTER FUNCTION test_create() OWNER TO masanip;

Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

#3Jignesh Shah
jignesh.shah1980@gmail.com
In reply to: A. Kretschmer (#2)
Re: [NOVICE] Not able to change the owner of function

Hey, I have read it and current user is 'postgres' and the new_user is also
looks fine but still the same error.

techdb=# select current_user;
current_user
--------------
postgres
(1 row)
techdb=# CREATE OR REPLACE FUNCTION test_create()
RETURNS void AS
$BODY$
$cmd = "CREATE TABLE testtable(col varchar not null);";
spi_exec_query("CREATE OR REPLACE FUNCTION myfunc() RETURNS void AS '$cmd'
LANGUAGE SQL;"); spi_exec_query("SELECT myfunc();");
$BODY$
LANGUAGE 'plperl';
CREATE FUNCTION
techdb=# ALTER FUNCTION test_create() SET OWNER TO user1;
ERROR: unrecognized configuration parameter "owner"
techdb=#

Thanks,
Jack
On Wed, Feb 24, 2010 at 11:51 AM, A. Kretschmer <
andreas.kretschmer@schollglas.com> wrote:

Show quoted text

In response to Jignesh Shah :

Hi,

could you tell me what could be the issue in below command. I could see

that

there is an option for changing OWNER of function but not sure why it is

giving

this error.

techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR: unrecognized configuration parameter "owner"

test=*# \h alter function
Command: ALTER FUNCTION
Description: change the definition of a function
Syntax:
ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] )
OWNER TO new_owner

Read that and try:

ALTER FUNCTION test_create() OWNER TO masanip;

Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

#4A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Jignesh Shah (#3)
Re: Not able to change the owner of function

In response to Jignesh Shah :

Hey, I have read it and current user is 'postgres' and the new_user is also
looks fine but still the same error.
techdb=# ALTER FUNCTION test_create() SET OWNER TO user1;
ERROR:� unrecognized configuration parameter "owner"

Read again, and type your command without SET.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

#5Frank Heikens
frankheikens@mac.com
In reply to: Jignesh Shah (#1)
Re: Not able to change the owner of function

Skip the SET-keyword:

ALTER FUNCTION test_create() OWNER TO masanip;

Regards,
Frank

Op 24 feb 2010, om 07:14 heeft Jignesh Shah het volgende geschreven:

Show quoted text

Hi,

could you tell me what could be the issue in below command. I could
see that there is an option for changing OWNER of function but not
sure why it is giving this error.

techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR: unrecognized configuration parameter "owner"
techdb=#

Thanks in advance,
Jack

#6Jignesh Shah
jignesh.shah1980@gmail.com
In reply to: Frank Heikens (#5)
Re: Not able to change the owner of function

Thanks :) I am going crazy at times.

On Wed, Feb 24, 2010 at 12:04 PM, Frank Heikens <frankheikens@mac.com>wrote:

Show quoted text

Skip the SET-keyword:

ALTER FUNCTION test_create() OWNER TO masanip;

Regards,
Frank

Op 24 feb 2010, om 07:14 heeft Jignesh Shah het volgende geschreven:

Hi,

could you tell me what could be the issue in below command. I could see
that there is an option for changing OWNER of function but not sure why it
is giving this error.

techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR: unrecognized configuration parameter "owner"
techdb=#

Thanks in advance,
Jack

#7Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Jignesh Shah (#1)
Re: Not able to change the owner of function

Jignesh Shah wrote:

could you tell me what could be the issue in below command. I
could see that there is an option for changing OWNER of
function but not sure why it is giving this error.

techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip;
ERROR: unrecognized configuration parameter "owner"
techdb=#

Just use the correct syntax as documented:

ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] )
OWNER TO new_owner

i.e., without the SET.

Yours,
Laurenz Albe