Tag Archives: tips

Hash as filename

md5, sha1, etc are very handy tools for programmers to generate hashed strings from random or fixed keys. A lot of the times, we simply store these hashes directly into databases, setting the field data type as string, or use the hashes as filenames (handy for creating cache files) or as part of URL. While [...]

Posted in Tips | Also tagged , , , , , , | 2 Comments

How to convert a char column to numeric in PostgreSQL

Attempting to ALTER a char column directly to numeric will result in the following error: ERROR: column “COL_NAME” cannot be cast to type numeric Here’s how to get around that: Verify data is ok & delete away the old column. I blog about PostgreSQL and other Linux sys admin stuffs on my Twitter (@uzyn) and [...]

Posted in Tips | Also tagged , | Leave a comment