Blogs by: Bryn Llewellyn

PostgreSQL Timestamps and Timezones: How to Navigate the Interval Minefield

PostgreSQL Timestamps and Timezones: How to Navigate the Interval Minefield

In the second part of this blog series on PostgreSQL and YSQL date-time data types, the focus shifts to representing durations, or how long things last. Assuming the reader has read the first part and downloaded the companion code kit, this post explores the relevant data types, including interval, timestamp difference, and other related functions.

Read more

Using the PostgreSQL Recursive CTE – Part Two

Using the PostgreSQL Recursive CTE – Part Two

Computing Bacon Numbers for actors listed in the IMDb

YugabyteDB is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. YugabyteDB uses its own special distributed document store called DocDB. But it provides SQL and stored procedure functionality by re-using the “upper half” of the standard PostgreSQL source code. This is explained in the two part blog post “Distributed PostgreSQL on a Google Spanner Architecture”: (1) Storage Layer;

Read more

Using the PostgreSQL Recursive CTE – Part One

Using the PostgreSQL Recursive CTE – Part One

Traversing an employee hierarchy

YugabyteDB is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. YugabyteDB uses its own special distributed document store called DocDB. But it provides SQL and stored procedure functionality by re-using the “upper half” of the standard PostgreSQL source code. This is explained in the two part blog post “Distributed PostgreSQL on a Google Spanner Architecture”: (1) Storage Layer;

Read more

Using PostgreSQL Aggregate Functions in YugabyteDB to Analyze COVID-19 Data

Using PostgreSQL Aggregate Functions in YugabyteDB to Analyze COVID-19 Data

YugabyteDB is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. YugabyteDB uses its own special distributed document store called DocDB. But it provides SQL and stored procedure functionality by re-using the “upper half” of the standard PostgreSQL source code. This is explained in the two part blog post “Distributed PostgreSQL on a Google Spanner Architecture”: (1) Storage Layer; and (2) Query Layer.

Read more

Polymorphism in SQL part two – variadic functions

Polymorphism in SQL part two – variadic functions

YugabyteDB is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. YugabyteDB uses its own special distributed document store called DocDB. But it provides SQL and stored procedure functionality by re-using the “upper half” of the standard PostgreSQL source code. This is explained in the two part blog post “Distributed PostgreSQL on a Google Spanner Architecture”: (1) Storage Layer; and (2) Query Layer.

Read more

Polymorphism in SQL part one – anyelement and anyarray

Polymorphism in SQL part one – anyelement and anyarray

The term “polymorphism”, and its inflections, has various meanings in the context of programming languages in general. Roughly, it means “chameleon-like”. Of course, Wikipedia has something to say about it, here. PostgreSQL uses it with this meaning: “Parametric polymorphism: when one or more types are not specified by name but by… symbols that can represent any type”.

The term “variadic” has a universal meaning,

Read more

Document Data Modeling in YugabyteDB with the JSON Data Types

Document Data Modeling in YugabyteDB with the JSON Data Types

YugabyteDB has two JSON data types, json and jsonb, to let you store documents in a column in a YSQL table and to do content-based queries with index support. YSQL is PostgreSQL compatible and it therefore supports every one of the rich set of about thirty five JSON-specific operators and functions that users of PostgreSQL’s JSON functionality might already know, and rely upon. These features let you handle semi-structured data,

Read more

Natural versus Surrogate Primary Keys in a Distributed SQL Database

Natural versus Surrogate Primary Keys in a Distributed SQL Database

There’s a subtle, but critical, difference between the two notions business-unique key and primary key in a relational database. For example, in a users” table, the “user_id” could be the primary key while the “email_address” (which must be not null and unique) could be the business-unique key. The columns that implement each notion may or may not coincide. This post shows that,

Read more

Explore Distributed SQL and YugabyteDB in Depth

Discover the future of data management.
Learn at Yugabyte University
Get Started
Browse Yugabyte Docs
Explore docs
PostgreSQL For Cloud Native World
Read for Free