Posts with tag: postgresql

Getting inserted SQL data with PostgreSQL and Go
 sql  postgresql
sql
When saving data to an SQL database, we often use some kind of autogenerated primary keys for our entities. It's very handy since we don't need to keep track of it and make sure we don't have duplicate identifiers. On the other hand, when inserting data we are not sure how we can retrieve it, as it wasn't chosen by us. Actually, using PostgreSQL it is very easy to achieve, so let's take a look how we can do that in a Golang application.
Bonus - Inheritance in PostgreSQL
 sql  postgresql
sql
We've taken a look at the ways to represent OOP inheritance in an SQL database: single table, multiple tables, and a reference table. We were using PostgreSQL for those examples, and this database allows us to use one more way of representing such a relation. Let's take a look on PostgreSQL's INHERITS.