Re: Allow COMMENT ON to accept an expression rather than just a string

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Abhijit Menon-Sen <ams(at)oryx(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow COMMENT ON to accept an expression rather than just a string
Date: 2009-04-11 18:08:21
Message-ID: 2875.1239473301@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2009/4/11 Bruce Momjian <bruce(at)momjian(dot)us>:
>> I remember adding the TODO after a request from the user, but I have not
>> seen further requests. I have remove the item; let's see if we get any
>> further requests for it.

> I thing so this TODO point is little bit step in bad direction.

I agree with Pavel that the originally suggested use-case seems like
a poor man's substitute for a missing database facility. But Abhijit's
question about parameters reminds me that there is a use-case from the
point of view of client-side libraries. You might wish to do something
like (pseudo-code here)

execute('COMMENT ON foo IS $1', some_string);

and let the out-of-line-parameter mechanism take care of quoting and
escaping your string. This doesn't work today, and I remember having
seen complaints about that on the JDBC list. So there's a use-case at
least for allowing parameter symbols in place of string literals, if not
fully general expressions. But again, I think we'd want such a thing
across all utility statements that can take string literals, not only
COMMENT.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-04-11 18:16:53 Re: Allow COMMENT ON to accept an expression rather than just a string
Previous Message Pavel Stehule 2009-04-11 17:29:15 Re: Allow COMMENT ON to accept an expression rather than just a string