Open liuhangyu opened 1 year ago
Why are you using pg_query_parse_plpgsql()
there instead of pg_query_parse()
? That statement is “plain” SQL
, isn't it?
Using the pg_query_parse function works fine, but I'm not sure if there is a bug in pg_query_parse_plpgsql
sql:
CREATE UNIQUE INDEX t_role_tcd_unique_index ON dino.t_role USING btree (tenant_id, \ code,(CASE WHEN (del_flag = 1) THEN id ELSE (del_flag)::bigint END)); cannot be parsed
int main() { PgQueryPlpgsqlParseResult result;
code,(CASE WHEN (del_flag = 1) THEN id ELSE (del_flag)::bigint END));"); if (result.error) { printf("error: %s at %d\n", result.error->message, result.error->cursorpos); } else { printf("%s\n", result.plpgsql_funcs); }
}
result.plpgsql_funcs output as []