Book Contents

Book Index

Next Topic

Home

HAS_TABLE_PRIVILEGE

HAS_TABLE_PRIVILEGE returns a true/false value indicating whether or not a user can access a table in a particular way.

Syntax

HAS_TABLE_PRIVILEGE ( [ user, ] table, privilege )

Semantics

 

user

specifies the name of a database user. The default is the CURRENT_USER.

table

specifies the name of a table in the logical schema.

privilege

SELECT

Allows the user to SELECT from any column of the specified table.

INSERT

Allows the user to INSERT tuples into the specified table and to use the COPY command to load the table.

UPDATE

Allows the user to UPDATE tuples in the specified table.

DELETE

Allows DELETE of a row from the specified table.

REFERENCES

To create a foreign key constraint, it is necessary to have this privilege on both the referencing and referenced tables.

 

Notes

Examples

SELECT HAS_TABLE_PRIVILEGE('mytable', 'SELECT');