ruleutils with pretty-print option

From: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: ruleutils with pretty-print option
Date: 2003-06-29 17:42:46
Message-ID: 3EFF2516.9080007@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

The attached patches will add
pg_get_ruledef(oid, int)
pg_get_viewdef(text, int)
pg_get_viewdef(oid, int)
pg_get_indexdef(oid, int)
pg_get_constraintdef(oid, int)
pg_get_expr(text, oid, int)

If the last parameter "pretty-print" is 0, these function will return
the same result as their original counterparts without that parameter.
The source is based on ruleutils.c 1.143, and should return exactly the
same result as before if no pretty-print is selected. My tests didn't
show any differences for pg_dump output with old or new version.

The pretty-print parameter is evaluated bit-wise.

PRETTY_PAREN 1 - Parentheses are checked; only necessary parentheses will be emitted.

PRETTY_INDENT 2 - pretty indentation and line formatting is performed

PRETTY_OPPAREN 4 - For T_BoolExpr operators, AND/OR/NOT precedence is checked, for T_OpExpr +-*/%
precedence is checked. If precedence is identified, parentheses are omitted.
This option is only active if PRETTY_PAREN is also used.

Regards,
Andreas

Attachment Content-Type Size
ruleutils.patch text/plain 52.4 KB
pg_proc.patch text/plain 1.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2003-06-29 20:04:42 Re: [HACKERS] Missing array support
Previous Message Joe Conway 2003-06-29 16:29:25 Re: CVS tip compile failure (was Re: Missing array support)