Category: Postgres

Postgres Blog Archives, by Peter Whyte (SQL Server Database Admin). Includes Postgres posts from a SQL Server DBA’s perspective!

  • Why Use WHERE 1=2 in SQL

    In a previous blog post, I explained why WHERE 1=1 is often used in SQL queries. This time, let’s discuss WHERE 1=2 — or any condition that results in a FALSE value, such as WHERE 1=9. Essentially, the point is to use a condition that is guaranteed to…

    Read More


  • How to Install Postgres on Ubuntu 20.04

    This post is a short note on how to install Postgres on Ubuntu 20.04. I’m doing this in WSL, however this shouldn’t make any difference if you’re on the same Ubuntu version. First, lets update our local packages by running the following apt command – This Postgres installation…

    Read More


  • List all Schemas, Tables & Columns in Redshift or Postgres

    This post contains a SQL script that will return all schemas, tables and columns in Redshift or Postgres. I’m combining the Redshift and Postgres database blog categories here. Redshift was forked from Postgres and is similar in a lot of ways. One of the feature differences between Redshift…

    Read More


  • Why use WHERE 1=1 in SQL Queries

    A common SQL question is, why would anyone use WHERE 1=1 in their queries? And what does it do? The WHERE 1=1 condition means WHERE TRUE. It returns the same query result as it would without the WHERE Clause. There is no impact on query execution time. This…

    Read More


  • Creating a Linked Server for a PostgreSQL Database

    This is a post on how to create a Linked Server to a PostgreSQL database. In my previous post, I created a Linked Server to another SQL Server instance. This time, it’s a link to a Postgres database. I recommend checking out my other post for pre-requisite information…

    Read More


  • Reset Default PostgreSQL User Password

    A common scenario working with Postgres is when you have forgotten your default Postgres user password. This is the password you will have entered during your Postgres installation. This is a guide on how to reset the default Postgres user password. This should hopefully help you resolve this…

    Read More


  • How To Install PostgreSQL on Windows

    PostgreSQL is a free open-source RDMS that is widely used and forked. Other than PostgreSQL itself, Redshift is the only other forked database I’ve ever touched. This blog post is a very simple wizard run-through of installing PostgreSQL and Stack Builder on Windows for testing. # Install PostgreSQL…

    Read More