/// <summary> /// Parses COMMENT ON INDEX. /// </summary> private static void ParseIndex(Parser parser, PgDatabase database) { var indexName = parser.ParseIdentifier(); var objectName = ParserUtils.GetObjectName(indexName); var schemaName = ParserUtils.GetSchemaName(indexName, database); if (database.SchemaIsIgnored(schemaName)) { return; } PgSchema schema = database.GetSchema(schemaName); PgIndex index = schema.GetIndex(objectName); if (index == null) { PgConstraint primaryKey = schema.GetPrimaryKey(objectName); parser.Expect("IS"); primaryKey.Comment = GetComment(parser); parser.Expect(";"); } else { parser.Expect("IS"); index.Comment = GetComment(parser); parser.Expect(";"); } }