Must be owner of function

Started by Jerry Richardsover 15 years ago2 messagesgeneral
Jump to latest
#1Jerry Richards
jerry.richards@teotech.com

I am using postgresql-odbc and trying to "CREATE OR REPLACE FUNCTION..."
from my C-Application, however, I get "must be owner of function ..." error.
If I execute the command logged in as postgres (i.e. su postgres), then I
can execute the command. I think I tried to grant privileges to public for
the tables/functions I'm using to no avail. I also tried to alter function
ownership, but this also gets an error because th function does not exist
yet.

Any help/guidance would be appreciated.

Thanks,
Jerry

#2John R Pierce
pierce@hogranch.com
In reply to: Jerry Richards (#1)
Re: Must be owner of function

On 07/27/10 3:39 PM, Jerry Richards wrote:

I am using postgresql-odbc and trying to "CREATE OR REPLACE FUNCTION..."
from my C-Application, however, I get "must be owner of function ..." error.
If I execute the command logged in as postgres (i.e. su postgres), then I
can execute the command. I think I tried to grant privileges to public for
the tables/functions I'm using to no avail. I also tried to alter function
ownership, but this also gets an error because th function does not exist
yet.

Any help/guidance would be appreciated.

postgres has seperate privileges at the database level (allow you to
connect), schema (such as public, allow you to see the schema, allow you
to add objects to the schema), and at the object (table, view) level
(grant/deny access, grant/deny update, etc).

also, databases and objects have individual ownership.

for simple applications without special security requirements, I create
the database owned by the user account that will be managing it, like...

log in as postgres,
CREATE USER someuser WITH PASSWORD 'whatever';
CREATE DATABASE somedb OWNED BY someuser;
log in as someuser,
CREATE TABLE ....
CREATE VIEW ...

etc.