16.20 - Restrictions on Dropping a Row-Level Security Constraint - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

Before you can drop a row-level security constraint, you must remove the constraint from all objects that reference the constraint.

You can use the following example SQL requests to determine which database objects have constraint assignments.

Finding Tables and Indexes with a Security Constraint

  1. Query the DBC.Dependency table to find tables that have a security constraint column:

    SELECT database1name, object1name from dbc.dependency where object2name='constraint_name ';

  2. Run the SHOW TABLE command for each table returned by the query in step 1. The system displays the standard CREATE TABLE for the table, including any indexes that are defined on the table.

Determining Whether a Column is a Security Constraint

You can execute a HELP COLUMN statement against a column to find out whether the column is a security constraint. See HELP COLUMN.

Finding Views that Include a Security Constraint

SELECT databasename, tvmname from dbc.tvm, dbc.dbase
where
tablekind='V' and
tvm.databaseid=dbase.databaseid and
tvmid in (select tableid from dbc.tvfields where constraintid in
(select constraintid from dbc.secconstraints where constraintname='constraint_name'));

Finding Users or Profiles with an Assigned Constraint

For users:

SELECT UserName from DBC.UsrAsgdSecConstraintsV
where
ConstraintName='constraint_name'

For profiles:

SELECT ProfileName from DBC.ProfileAsgdSecConstraintsV
where
ConstraintName='constraint_name'