Skip to content

Tag: postgresql

Selecting by month in PostgreSQL

I want to select rows according to the month of a date or timestamp column like this: But I only get error messages in PostgreSQL. How can this be done? Answer You can use EXTRACT function, like this: Your problem comes from the fact that there is no such thing as Month function in PostgreSQL. Check online do…

Change PostgreSQL columns used in views

I would like PostegreSQL to relax a bit. Every time I want to change a column used in a view, it seems I have to drop the view, change the field and then recreate the view. Can I waive the extra protection and just tell PostgreSQL to let me change the field and then figure out the adjustment to the