if(getTableTypes[j][0].equals(types[i])) {
+ if(notFirst)
+ sql.append(" or ");
sql.append(getTableTypes[j][1]);
notFirst=true;
}
//
// IMPORTANT: the query must be enclosed in ( )
private static final String getTableTypes[][] = {
- {"TABLE", "(relkind='r' and relname !~ '^pg_' and relname !~ '^xinv')"},
+ {"TABLE", "(relkind='r' and relhasrules='f' and relname !~ '^pg_' and relname !~ '^xinv')"},
+ {"VIEW", "(relkind='r' and relhasrules='t' and relname !~ '^pg_' and relname !~ '^xinv')"},
{"INDEX", "(relkind='i' and relname !~ '^pg_' and relname !~ '^xinx')"},
{"LARGE OBJECT", "(relkind='r' and relname ~ '^xinv')"},
{"SEQUENCE", "(relkind='S' and relname !~ '^pg_')"},
// These are the default tables, used when NULL is passed to getTables
// The choice of these provide the same behaviour as psql's \d
private static final String defaultTableTypes[] = {
- "TABLE","INDEX","SEQUENCE"
+ "TABLE","VIEW","INDEX","SEQUENCE"
};
/**