.and(PG_PROC.PRORETSET))
.asTable("tables"))
.orderBy(1, 2)
.fetch()) {
SchemaDefinition schema = getSchema(record.getValue(TABLES.TABLE_SCHEMA));
String name = record.getValue(TABLES.TABLE_NAME);
boolean tableValuedFunction = record.getValue("table_valued_function", boolean.class);
String comment = record.getValue(PG_DESCRIPTION.DESCRIPTION, String.class);
if (tableValuedFunction) {
result.add(new PostgresTableValuedFunction(schema, name, record.getValue(ROUTINES.SPECIFIC_NAME), comment));
}
else {
PostgresTableDefinition t = new PostgresTableDefinition(schema, name, comment);
result.add(t);
map.put(name(schema.getName(), name), t);
}
}
PgClass ct = PG_CLASS.as("ct");
PgNamespace cn = PG_NAMESPACE.as("cn");