Thread: BUG #11702: Identity column error

BUG #11702: Identity column error

From
abhishekmvn@gmail.com
Date:
The following bug has been logged on the website:

Bug reference:      11702
Logged by:          Abhishek
Email address:      abhishekmvn@gmail.com
PostgreSQL version: 9.3.3
Operating system:   Windows 7
Description:

How do i restrict the Server not to accept a manual insertion of identity
column value. This is causing an exception in the App when we have multiple
users using the same table and one of them doing a insertion of value in
Identity column.
Expecting a reply from you.

Regards.

Re: BUG #11702: Identity column error

From
David G Johnston
Date:
abhishekmvn wrote
> The following bug has been logged on the website:
>
> Bug reference:      11702
> Logged by:          Abhishek
> Email address:

> abhishekmvn@

> PostgreSQL version: 9.3.3
> Operating system:   Windows 7
> Description:
>
> How do i restrict the Server not to accept a manual insertion of identity
> column value. This is causing an exception in the App when we have
> multiple
> users using the same table and one of them doing a insertion of value in
> Identity column.
> Expecting a reply from you.

This is not a bug.  In the future reports of this nature should be directed
to the general mailing list.

When you give the users in question permission to INSERT on the table you
have to specify the columns they are allowed to insert to.

http://www.postgresql.org/docs/9.4/interactive/sql-grant.html

Per the comment for "INSERT" all other columns will be forced to receive
default values.

Given: tablea (id, val)
GRANT INSERT (val) ON TABLE tablea TO ...;

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-11702-Identity-column-error-tp5823423p5823453.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.