Обсуждение: Insufficient privileges.

Поиск
Список
Период
Сортировка

Insufficient privileges.

От
Dave Coventry
Дата:
I am getting the following error message in my Drupal install.

PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR:
permission denied for sequence currenttest_id_seq: INSERT INTO
currentTest (score) VALUES (:db_insert_placeholder_0);

This is a table that I created using the postgres super user.

I have tried to grant the drupal user (drupaluser) privileges to the table with:

GRANT ALL ON currentTest to drupaluser;

but this fails to resolve the issue.

Can anyone suggest a way forward?

Dave Coventry

Re: Insufficient privileges.

От
Rick Genter
Дата:


On Thu, Jul 7, 2011 at 10:03 AM, Dave Coventry <dgcoventry@gmail.com> wrote:
I am getting the following error message in my Drupal install.

PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR:
permission denied for sequence currenttest_id_seq: INSERT INTO
currentTest (score) VALUES (:db_insert_placeholder_0);

This is a table that I created using the postgres super user.

I have tried to grant the drupal user (drupaluser) privileges to the table with:

GRANT ALL ON currentTest to drupaluser;

but this fails to resolve the issue.

Can anyone suggest a way forward?

From the message I'd say that the drupal user doesn't have access to the sequence, which is a separate object from the table.

--
Rick Genter
rick.genter@gmail.com

Re: Insufficient privileges.

От
Dave Coventry
Дата:
Hi Rick,

Thanks for the response.

What is "the sequence"? and how do I grant the privileges needed to
insert data into the database?

Is it a postgres issue?

~ Dave

On 7 July 2011 19:05, Rick Genter <rick.genter@gmail.com> wrote:
>
>
> On Thu, Jul 7, 2011 at 10:03 AM, Dave Coventry <dgcoventry@gmail.com> wrote:
>>
>> I am getting the following error message in my Drupal install.
>>
>> PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR:
>> permission denied for sequence currenttest_id_seq: INSERT INTO
>> currentTest (score) VALUES (:db_insert_placeholder_0);
>>
>> This is a table that I created using the postgres super user.
>>
>> I have tried to grant the drupal user (drupaluser) privileges to the table
>> with:
>>
>> GRANT ALL ON currentTest to drupaluser;
>>
>> but this fails to resolve the issue.
>>
>> Can anyone suggest a way forward?
>
> From the message I'd say that the drupal user doesn't have access to the
> sequence, which is a separate object from the table.
>
> --
> Rick Genter
> rick.genter@gmail.com
>
>

Re: Insufficient privileges.

От
Rick Genter
Дата:


On Thu, Jul 7, 2011 at 10:26 AM, Dave Coventry <dgcoventry@gmail.com> wrote:
Hi Rick,

Thanks for the response.

What is "the sequence"? and how do I grant the privileges needed to
insert data into the database?

Is it a postgres issue?

Yes. I don't know drupal, so I don't know the correct way to fix this. My guess is that something wasn't installed/configured correctly.
--
Rick Genter
rick.genter@gmail.com

Re: Insufficient privileges.

От
John R Pierce
Дата:
On 07/07/11 10:03 AM, Dave Coventry wrote:
> I am getting the following error message in my Drupal install.
>
> PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR:
> permission denied for sequence currenttest_id_seq: INSERT INTO
> currentTest (score) VALUES (:db_insert_placeholder_0);
>
> This is a table that I created using the postgres super user.
>
> I have tried to grant the drupal user (drupaluser) privileges to the table with:
>
> GRANT ALL ON currentTest to drupaluser;
>
> but this fails to resolve the issue.
>
> Can anyone suggest a way forward?
>
> Dave Coventry
>


I recommend dropping your drupal database (since I doubt its worked
right if the objects are owned by postgres), and recreate it owned by
the drupaluser, then let the drupaluser populate it during the initial
install.

or, if I'm misreading your problem, and drupal itself is running but
this is an extra non-drupal table you manually created, then ALTER TABLE
.... OWNER drupaluser;

drupal doesn't really interface very well to non-drupal data...   the
drupal approach is to define a new content type with the fields you
need, then populate it via create content, choosing that new type, or
use the various drupal APIs from your custom PHP modules.



--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


Re: Insufficient privileges.

От
Dave Coventry
Дата:
Hi John,

Thanks.

On 7 July 2011 21:48, John R Pierce <pierce@hogranch.com> wrote:
> I recommend dropping your drupal database (since I doubt its worked right if
> the objects are owned by postgres), and recreate it owned by the drupaluser,
> then let the drupaluser populate it during the initial install.

:~)

Well that's a little drastic at this stage!

In actual fact the database drupaldb is owned by the drupaluser, so
it's not really necessary.

> or, if I'm misreading your problem, and drupal itself is running but this is
> an extra non-drupal table you manually created, then ALTER TABLE .... OWNER
> drupaluser;

Yes, that's what I was trying to do. Using the Drupal Nodes seems
awfully cumbersome for what I'm trying to achieve so I added a sort of
scratch table that I was hoping to manipulate. I have gone back to
using the prescribed Drupal method as time was starting to run out and
I needed a working prototype.

I do intend to return to using the scratch table after the rush is
over and I'll give your suggestion a try: it looks as though it may
very well do the trick.

> drupal doesn't really interface very well to non-drupal data...   the drupal
> approach is to define a new content type with the fields you need, then
> populate it via create content, choosing that new type, or use the various
> drupal APIs from your custom PHP modules.

Yes, I'm finding that out.

Thanks very much for your input.

Regards,

Dave Coventry

Re: Insufficient privileges.

От
"Albe Laurenz"
Дата:
Dave Coventry wrote:
> I am getting the following error message in my Drupal install.
>
> PDOException: SQLSTATE[42501]: Insufficient privilege: 7 ERROR:
> permission denied for sequence currenttest_id_seq: INSERT INTO
> currentTest (score) VALUES (:db_insert_placeholder_0);
>
> This is a table that I created using the postgres super user.
>
> I have tried to grant the drupal user (drupaluser) privileges
> to the table with:
>
> GRANT ALL ON currentTest to drupaluser;
>
> but this fails to resolve the issue.
>
> Can anyone suggest a way forward?

GRANT USAGE on SEQUENCE currenttest_id_seq TO drupaluser;

I think that it is a good idea to have different users for
table creation and usage (if possible).
But I would not use a superuser account.

Yours,
Laurenz Albe