Install Postgres.app on a Mac

The easiest way to install PostgreSQL on a Mac is by installing Postgres.app. Postgres.app is a full-featured PostgreSQL installation packaged as a standard Mac application.

You simply download it and drag it to your Applications folder, just like with any other application.

Read more

How to Format Numbers in PostgreSQL

When working with Postgres, you can use the to_char() function to output numbers in a given format.

The way it works is that you provide two arguments. The first argument is the number to be formatted. The second argument determines how it is formatted.

The return value is text.

Depending on your requirements, you might prefer to convert the number to the appropriate data type, for example using the cast() function.

Examples of both methods are below.

Read more