Digital Craftsman
  • Search
Sign in Subscribe

postgres

A collection of 3 posts
Delete JSON property in Postgres
postgres

Delete JSON property in Postgres

When migrating JSON data in Postgres, it's often necessary to delete properties within a JSON object. There's a neat operator for it #-. In this example the property comment was stored as an empty string instead of the property just missing. So we delete the property for all domain messages
Dec 26, 2022
Add NOT NULL constraint on column in Postgress
postgres

Add NOT NULL constraint on column in Postgress

You can't just add a new non-nullable column to a table when it already has entries in it, as those would be pre filled with NULL. An easy solution is to create it with DEFAULT NULL, update the data and then make it non-nullable. This can look like this: ALTER
Mar 1, 2021
Adapt timezones on Heroku
heroku

Adapt timezones on Heroku

I'm using the dynos of Heroku and the Postgres database addon from Heroku. Both are on UTC by default and Heroku is specifically advising against changing it. So make sure you know the repercussions. Dynos For the dynos you can simple use an environment variable called TZ and set it
Sep 14, 2020 1 min read
Page 1 of 1
Digital Craftsman © 2023
  • Datenschutz
  • Impressum
Powered by Ghost