postgresql cast as year and month from timestamp code example Example: postgresql cast as year and month from timestamp EXTRACT(field FROM source)