Start Now

PostgreSQL Timestamps and Timezones: How to Navigate the Interval Minefield

This is the second of a two part blog post series about the date-time data types that PostgreSQL, and therefore YSQL, support. The first part dealt with the basic business of representing moments (when things happen). The relevant data types here are time, date, and timestamp—where the latter has a without time zone and a with time zone variant.

Read more

PostgreSQL Timestamps and Timezones: What You Need to Know—and What You Don’t

Anecdotal reports indicate that some PostgreSQL programmers are daunted by the date and time data types, and by how operations that use values of these data types might be affected by the session’s timezone setting. Even experienced developers struggle when they first embark on a critical project that relies on this functionality. YugabyteDB’s YSQL subsystem gives the application developer the same experience as PostgreSQL. So some YSQL users will find the topic challenging, too.

I recently completed a careful and exhaustive study of the topic so that I could write it all up in YugabyteDB’s YSQL documentation.

Read more

A SQL Stopwatch Utility for YugabyteDB or PostgreSQL as an Alternative for “\timing on”

This blog post shows you a few ways to use SQL to implement a timer for any multi-statement operation for use with ysqlsh with YugabyteDB (or psql with PostgreSQL). These tools are the overwhelmingly common choice for all sorts of ad hoc tasks as well as for critical tasks like running installation scripts. The native \timing on” feature times only individual SQL statements.

Read more

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

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

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

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

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

Follow-up: Postgres Conference Webinar – Introduction to YugabyteDB

I delivered the webinar “YugabyteDB: a distributed PostgreSQL database” last week. It was hosted by Postgres Conference in a series that they’d arranged so that the speakers who’d been selected to speak at their big annual conference in New York City in March could reach their audience. COVID-19 brought that event’s cancellation. This brief post tells you where you can find the edited videorecording and the PDF version of the slides that I used. It also gives me the chance to answer the couple of questions from attendees that shortness of time prevented me from answering during the webinar.

Read more

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

Get started in any cloud, container or data center