Re: psql dynamic comments

Поиск
Список
Период
Сортировка
От Fabrízio de Royes Mello
Тема Re: psql dynamic comments
Дата
Msg-id AANLkTikKRUbxCJpCpw9jYUz96tWDcE+TCV94xtcrbSmu@mail.gmail.com
обсуждение исходный текст
Ответ на psql dynamic comments  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
Список pgsql-general


2010/10/6 Little, Douglas <DOUGLAS.LITTLE@orbitz.com>

 

 

Unfortunately the variable doesn’t get replaced due to the quotes.

COMMENT ON INDEX mdm_mart_tbls.mdm_gotoastcampaignevt_pk IS 'created by dwda-1618 on :currtime';

 

I’ve tried various options,  2,3,4 quotes.  Concatenation, Building the entire string as the variable.  But nothing seems to work.

 

Any suggestions?

 



Try this:


postgres@bdteste=# \set message ''''`echo 'Created by Fabrizio on '``date '+20%y-%m-%d %H:%M:%S'`''''
postgres@bdteste=# comment on table city is :message;
COMMENT
postgres@bdteste=# \dt+ city
                                      Lista de relações
 Esquema | Nome |  Tipo  |   Dono   |  Tamanho   |                 Descrição                  
---------+------+--------+----------+------------+--------------------------------------------
 public  | city | tabela | postgres | 8192 bytes | Created by Fabrizio on 2010-10-06 12:39:04
(1 linha)


--
Fabrízio de Royes Mello
>> Blog sobre TI: http://fabriziomello.blogspot.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Sairam Krishnamurthy
Дата:
Сообщение: Re: Having two simultaneous and similar database
Следующее
От: "Gauthier, Dave"
Дата:
Сообщение: DB relpication how-to doc?