Archive for March, 2008

How to deal with IMMUTABLE error in indexes that work with timestamps

Wednesday, March 19th, 2008

Say that in an older version of PostgreSQL you had an index like this:

  1. CREATE INDEX logTypeDay ON myLog (eventType, date_trunc(‘day’, creationTime));

and now after upgrading to 8.1+ you’re getting:
ERROR: functions in index expression must be marked IMMUTABLE


How to concatenate two object attributes and assign the result to a variable

Tuesday, March 4th, 2008

All right, this is really no rocket science it’s just something I needed and took me some time to figure out.

  1. {assign var="fullName" value="`$human->first` `$human->last`"}

or more robust version:

  1. {capture assign="fullName"}
  2. {$human->first} {$human->last}
  3. {/capture}