pg_get_viewdef 7.4 parentheses

From: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_get_viewdef 7.4 parentheses
Date: 2003-04-07 16:48:55
Message-ID: 3E91ABF7.1020103@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While implementing a function for making view definitions look prettier
in pgadmin3, I had a look at ruleutils.c to examine why there are tons
of parentheses coming out of pg_get_viewdef. I believe that some are
really not needed.

These are:
- get_rule_expr, for CASES T_RelabelType and T_CoerceToDomain. The cast
is always bound to the near left variable, so it can be left out.
- get_from_clauses for ON. Operators will deliver what is needed.

for get_rule_expr and get_from_clauses(JOIN part), parentheses could be
omitted if the top-level expression is evaluated.

Do you agree?

Regards,
Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-04-07 17:03:15 Re: information_schema 7.4
Previous Message Lamar Owen 2003-04-07 15:45:07 Re: more contrib: log rotator