A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://neon.com/postgresql/postgresql-tutorial/postgresql-data-types below:

Getting Started with PostgreSQL Data Types

Summary: in this tutorial, you will learn about PostgreSQL data types including Boolean, character, numeric, temporal, array, json, UUID, and special types.

PostgreSQL supports the following data types:

A Boolean data type can hold one of three possible values: true, false, or null. You use boolean or bool keyword to declare a column with the Boolean data type.

When you insert data into a Boolean column, PostgreSQL converts it to a Boolean value

When you select data from a Boolean column, PostgreSQL converts the values back e.g., t to true, f to false and space to null.

PostgreSQL provides three character data types: CHAR(n), VARCHAR(n), and TEXT

PostgreSQL provides two distinct types of numbers:

There are three kinds of integers in PostgreSQL:

There are three main types of floating-point numbers:

The temporal data types allow you to store date and /or time data. PostgreSQL has five main temporal data types:

The TIMESTAMPTZ is PostgreSQL’s extension to the SQL standard’s temporal data types.

In PostgreSQL, you can store an array of strings, an array of integers, etc., in array columns. The array comes in handy in some situations e.g., storing days of the week, and months of the year.

PostgreSQL provides two JSON data types: JSON and JSONB for storing JSON data.

The JSON data type stores plain JSON data that requires reparsing for each processing, while JSONB data type stores JSON data in a binary format which is faster to process but slower to insert. In addition, JSONB supports indexing, which can be an advantage.

The UUID data type allows you to store Universal Unique Identifiers defined by RFC 4122  . The UUID values guarantee a better uniqueness than SERIAL and can be used to hide sensitive data exposed to the public such as values of id in URL.

Besides the primitive data types, PostgreSQL also provides several special data types related to geometry and network.

In this tutorial, we have introduced you to the PostgreSQL data types so that you can use them to create tables in the next tutorial.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4