Re: Comments on tables

From: Vibhor Kumar <vibhor(dot)kumar(at)enterprisedb(dot)com>
To: pasman pasmański <pasman(dot)p(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Comments on tables
Date: 2010-11-10 15:39:03
Message-ID: 3C1983E6-9F77-4F98-BDE4-E0C23F390F89@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Nov 10, 2010, at 2:55 PM, pasman pasmański wrote:

> How to add comment on table with calculated value ?
>
> COMMENT ON TABLE test IS 'Updated ' || current_date;

You can create function to do that.

Or

If you are using PG9.0, then DO would help you, as given below:
do $$
Declare
t text;
begin
t:='COMMENT ON TABLE TEST_COPY IS '||''''||'TEST WITH '||current_date||'''';
execute t;
end;
$$ language plpgsql;

Thanks & Regards,
Vibhor Kumar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason 2010-11-10 16:31:38 PostgreSQL 8.2.3
Previous Message Bjørn T Johansen 2010-11-10 15:21:49 Re: Does not use index on query using "field is null"?