Postgres -Another ride with an Elephant

Postgres -Another ride with an Elephant

Table of Contents

Postgres Docs by Neon

I have been Neon for a quite while now and I am feeling the need to get deeper insights on PG.

So, going the docs and will list out some important things I encounter.

Geospatial database

alt text

Really cute isn’t it!

PostgreSQL with the PostGIS extension supports geospatial databases for geographic information systems (GIS).

Database:

Okay so the docs is about to start with a sample database of DVD rental store with:

You can create a local pod in Podman for PG, read here or look for “Create Postgres Pod” around November 30, 2023 blog.

alt text

If you have a local pod of PG then you need to upload the .rar file to PGAdmin.

Database has been loaded.

The Index

Here I want first see about Joins

Joins

PostgreSQL join is used to combine columns from one (self-join) or more tables based on the values of the common columns between related tables. The common columns are typically the primary key columns of the first table and the foreign key columns of the second table.

Inner Join

inner join

Left Join

In the left join context, the first table is called the left table and the second table is called the right table.

alt text

Right Join

alt text

Full outer join

The full outer join or full join returns a result set that contains all rows from both left and right tables, with the matching rows from both sides if available.

alt text

Group By

Important!

alt text