Re: pg_get_viewdef 7.4 parentheses

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_get_viewdef 7.4 parentheses
Date: 2003-04-08 23:27:14
Message-ID: 2940.1049844434@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de> writes:
> 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.

The difficulty is to know which ones *are* needed in complex
expressions. If you think that any of them are always unnecessary,
you haven't thought hard enough. For example:

> - 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.

What if the argument isn't just a variable?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinji Teragaito 2003-04-08 23:53:08 Re: HP-UX 11.22 (IA64) IPF Patch for PostgreSQL 7.3.2
Previous Message Andrew Sullivan 2003-04-08 23:05:18 Re: Anyone working on better transaction locking?