Search code examples
sqlforeign-keyshsqldb

HSQLDB list all constraints


Does anyone know how to list all constraints, or query for a particular Foreign Key constraint e.g. FK1234567890 in HSQLDB?

In other databases there are special system tables for this, but I can't find anything on the docs for this one.

Thanks, N.


Solution

  • HSQLDB system tables are listed in the Guide

    http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_information_schema

    The INFORMATION_SCHEMA.TABLE_CONSTRAINTS view has the overall information. Other tables list the columns used in constraints.