Re: Create table command fails with permission denied

Lists: pgsql-sql
From: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Create table command fails with permission denied
Date: 2009-08-03 12:08:21
Message-ID: 22640DE58AF78445BA8AB69FF76F07321AA2C20BAB@BLRKECMBX01.ad.infosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hi,
I'm new to PostgreSQL, and currently facing an issue with PostgreSQL 7.4 database. I'm getting the following error when tried to create a table. Please let me know the steps (with queries) that I should take care to resolve this issue.

cms=# create table test(id character varying(80));
ERROR: could not create relation "test": Permission denied

Thanks in advance,
Venkat


From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Create table command fails with permission denied
Date: 2009-08-03 22:02:57
Message-ID: 4A775E91.4090608@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Looks to me as though you are not the owner of the schema nor superuser
nor in a role with permission to create tables in said schema. See the
DBA if it's not you. If it is sign on as postgres (superuser) and grant
yourself some access rights.

Venkateswara Rao Bondada wrote:
>
> Hi,
>
> I’m new to PostgreSQL, and currently facing an issue with PostgreSQL
> 7.4 database. I’m getting the following error when tried to create a
> table. Please let me know the steps (with queries) that I should take
> care to resolve this issue.
>
> cms=# create table test(id character varying(80));
>
> ERROR: could not create relation "test": Permission denied
>
> Thanks in advance,
>
> Venkat
>


From: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Create table command fails with permission denied
Date: 2009-08-04 08:11:29
Message-ID: 22640DE58AF78445BA8AB69FF76F07321AA2C2100A@BLRKECMBX01.ad.infosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hi Rob,
I'm using postgres account (which is a superuser in the database) to create table. Table creation is working fine in other databases except in this. As postgres user, I granted CREATE, USAGE & ALL privileges to postgres account, still it didn't work.
Please find the snapshots below where it works fine and also where it doesn't work fine. And let me know what rights postgres account is missing to create tables in "cms" database.

==========================================
camd=# \c camd postgres
You are now connected to database "camd" as user "postgres".
camd=# create table test(id character varying(80));
CREATE TABLE
camd=# \c cms postgres
You are now connected to database "cms" as user "postgres".
cms=# create table test(id character varying(80));
ERROR: could not create relation "test": Permission denied
cms=#
==========================================

Thanks,
Venkat

-----Original Message-----
From: Rob Sargent [mailto:robjsargent(at)gmail(dot)com]
Sent: Tuesday, August 04, 2009 3:33 AM
To: Venkateswara Rao Bondada
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Create table command fails with permission denied

Looks to me as though you are not the owner of the schema nor superuser
nor in a role with permission to create tables in said schema. See the
DBA if it's not you. If it is sign on as postgres (superuser) and grant
yourself some access rights.

Venkateswara Rao Bondada wrote:
>
> Hi,
>
> I'm new to PostgreSQL, and currently facing an issue with PostgreSQL
> 7.4 database. I'm getting the following error when tried to create a
> table. Please let me know the steps (with queries) that I should take
> care to resolve this issue.
>
> cms=# create table test(id character varying(80));
>
> ERROR: could not create relation "test": Permission denied
>
> Thanks in advance,
>
> Venkat
>


From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Create table command fails with permission denied
Date: 2009-08-04 16:32:13
Message-ID: 4A78628D.7070503@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Moderately curious.

I wonder if 'cms' is on a different tablespace? Are there tables in that db?

Btw, I don't have 7.4 so I'm only guessing based on 8.3

rjs

Venkateswara Rao Bondada wrote:
> Hi Rob,
> I'm using postgres account (which is a superuser in the database) to create table. Table creation is working fine in other databases except in this. As postgres user, I granted CREATE, USAGE & ALL privileges to postgres account, still it didn't work.
> Please find the snapshots below where it works fine and also where it doesn't work fine. And let me know what rights postgres account is missing to create tables in "cms" database.
>
> ==========================================
> camd=# \c camd postgres
> You are now connected to database "camd" as user "postgres".
> camd=# create table test(id character varying(80));
> CREATE TABLE
> camd=# \c cms postgres
> You are now connected to database "cms" as user "postgres".
> cms=# create table test(id character varying(80));
> ERROR: could not create relation "test": Permission denied
> cms=#
> ==========================================
>
> Thanks,
> Venkat
>
>
> -----Original Message-----
> From: Rob Sargent [mailto:robjsargent(at)gmail(dot)com]
> Sent: Tuesday, August 04, 2009 3:33 AM
> To: Venkateswara Rao Bondada
> Cc: pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] Create table command fails with permission denied
>
> Looks to me as though you are not the owner of the schema nor superuser
> nor in a role with permission to create tables in said schema. See the
> DBA if it's not you. If it is sign on as postgres (superuser) and grant
> yourself some access rights.
>
>
>
> Venkateswara Rao Bondada wrote:
>
>> Hi,
>>
>> I'm new to PostgreSQL, and currently facing an issue with PostgreSQL
>> 7.4 database. I'm getting the following error when tried to create a
>> table. Please let me know the steps (with queries) that I should take
>> care to resolve this issue.
>>
>> cms=# create table test(id character varying(80));
>>
>> ERROR: could not create relation "test": Permission denied
>>
>> Thanks in advance,
>>
>> Venkat
>>
>>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
> for the use of the addressee(s). If you are not the intended recipient, please
> notify the sender by e-mail and delete the original message. Further, you are not
> to copy, disclose, or distribute this e-mail or its contents to any other person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
> every reasonable precaution to minimize this risk, but is not liable for any damage
> you may sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves the
> right to monitor and review the content of all messages sent to or from this e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Create table command fails with permission denied
Date: 2009-08-05 01:16:02
Message-ID: 25959.1249434962@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com> writes:
> camd=# \c cms postgres
> You are now connected to database "cms" as user "postgres".
> cms=# create table test(id character varying(80));
> ERROR: could not create relation "test": Permission denied

Actually, what that is complaining about is that the operating system
refused its attempt to create a filesystem file to hold the table.
It's got nothing to do with permissions inside the database --- there
is something wrong with the filesystem permissions of the data
directory. Or maybe you started the postmaster as the wrong user
(not the one that owns the data directory).

regards, tom lane


From: Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Create table command fails with permission denied
Date: 2009-08-05 17:05:54
Message-ID: 22640DE58AF78445BA8AB69FF76F07321AA2D51550@BLRKECMBX01.ad.infosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

Hi Tom,
Thanks a lot. What you suspected is correct. Permissions are modified on the underlying OS directory of this database. Once the permissions are rectified, I'm able to create tables without any issues.

Thanks to all for your support.

Venkat

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, August 05, 2009 6:46 AM
To: Venkateswara Rao Bondada
Cc: Rob Sargent; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Create table command fails with permission denied

Venkateswara Rao Bondada <Venkateswara_B(at)infosys(dot)com> writes:
> camd=# \c cms postgres
> You are now connected to database "cms" as user "postgres".
> cms=# create table test(id character varying(80));
> ERROR: could not create relation "test": Permission denied

Actually, what that is complaining about is that the operating system
refused its attempt to create a filesystem file to hold the table.
It's got nothing to do with permissions inside the database --- there
is something wrong with the filesystem permissions of the data
directory. Or maybe you started the postmaster as the wrong user
(not the one that owns the data directory).

regards, tom lane