Search Postgresql Archives

Re: psql dynamic comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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

 

 

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
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux