Search Postgresql Archives

psql dynamic comments

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

 



I’m trying to generate a comment on all my changes – so I know when they were completed.

 

Does anybody have anything that does this.

 

I think the psql script is something like

 

d1gp1=> \set currtime `date '+20%y-%m-%d %H:%M:%S'`

d1gp1=> \echo :currtime

2010-10-06 10:01:51

 

d1gp1=> comment on index mdm_mart_tbls.mdm_gotoastcampaignevt_pk is 'created by dwda-1618 on :currtime';

COMMENT

 

 

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?

 

Thanks in advance.

Doug

 

Doug Little

 

Sr. Data Warehouse Architect | Enterprise Data Management | Orbitz Worldwide

500 W. Madison, Suite 1000  Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741

Douglas.Little@xxxxxxxxxx

 cid:image001.jpg@01CABEC8.D4980670  orbitz.com | ebookers.com | hotelclub.com | cheaptickets.com | ratestogo.com | asiahotels.com

 


[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