pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jon Horsman <horshaq@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Permission denied for sequece...
Date: Mon, 21 Aug 2006 15:03:42 -0400
Message-ID: <4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com> (raw)

Hey,

I'm in the process of porting an app from MySQL to PostgreSQL and am
pretty new with PostgreSQL and am having permission problems.

First, a little background info.
- The postmaster is set to startup with -i and i'm able to actually
connect without an exception.
- I've added the following lines to the pg_hba.conf files (for testing purposes)
local all all trust
host all all 127.0.0.1 255.255.255.255 trust

I create my db, as follows:
createdb testdb

then i log into psql and run the following
CREATE USER testuser PASSWORD 'default';
GRANT ALL ON DATABASE testdb TO testuser;
GRANT ALL ON [my table names] TO testuser;

In my app i connect to the db with the following, which is run without issue.
connection = DriverManager.getConnection("jdbc:postgresql:testdb",
"testuser", "default");

I then call the following insert
INSERT INTO Property (Name,Value) VALUES ("some name", "some value")

and get the following error

org.postgresql.util.PSQLException: ERROR: permission denied for
sequence property_propertyid_seq

The sql used to create the property table is

CREATE TABLE Property
	(PropertyID SERIAL PRIMARY KEY,
	Name VARCHAR(64) UNIQUE NOT NULL,
	Value VARCHAR(255) NOT NULL);

Can someone tell me what would cause this error message to occur and
suggest ways that i could fix it?

Thanks,

Jon Horsman



view thread (4+ messages)  latest in thread

Message-ID: <4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com>
Permalink:  ../4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com/
Also on:    postgresql.org/message-id/4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: horshaq@gmail.com
  Subject: Re: Permission denied for sequece...
  In-Reply-To: <4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com>
  References: <4f4c2a010608211203j6591249cifc9c0a793183aee@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox