Learned something new today that will come in very handy next time I'm about to pick up a manual or search the PostgreSQL documentation with Google.

In psql if you run \dC you get a list of casts. Here's the header:


                           List of casts
   Source type    |    Target type    |   Function    | Implicit? 
------------------+-------------------+---------------+-------------

This is very handy when you need to know, for example, which cast to use when to cast a value of type date to timestamp without time zone you use timestamp. Most of these are pretty obvious and the PostgreSQL book is never far away on my desk, but the interesting thing is that I came across this function by accident when running psql.

(was this the most boring thing I've written here in a long time?)

Comments

Your email will never ever be published.

Previous:
Kingdom of Crap May 7, 2005 Film
Next:
Susan Senator's book May 11, 2005 Misc. links
Related by category:
set -ex - The most useful bash trick of the year August 31, 2014 Linux
brotli_static in Nginx November 8, 2024 Linux
Be very careful with your add_header in Nginx! You might make your site insecure February 11, 2018 Linux
Linux tip: du --max-depth=1 September 27, 2007 Linux
Related by keyword:
Adding client-to-server sync to PissueTracker March 20, 2025 React, JavaScript, Bun
Connecting with psycopg2 without a username and password February 24, 2011 Python
UPPER vs. ILIKE April 19, 2010 Web development
How I performance test PostgreSQL locally on macOS December 10, 2018 Web development, PostgreSQL, macOS