final String objectName = ParserUtils.getObjectName(columnName);
final String tableName = ParserUtils.getSecondObjectName(columnName);
final String schemaName = ParserUtils.getThirdObjectName(columnName);
final PgSchema schema = database.getSchema(schemaName);
final PgTable table = schema.getTable(tableName);
if (table == null) {
final PgView view = schema.getView(tableName);
parser.expect("IS");
final String comment = getComment(parser);
if (comment == null) {
view.removeColumnComment(objectName);
} else {
view.addColumnComment(objectName, comment);
}
parser.expect(";");
} else {
final PgColumn column = table.getColumn(objectName);
if (column == null) {
throw new ParserException(MessageFormat.format(
Resources.getString("CannotFindColumnInTable"),
columnName, table.getName()));
}
parser.expect("IS");
column.setComment(getComment(parser));
parser.expect(";");