---
title: "Linear interpolation with Postgres"
publication: "Postgres Weekly"
issue: 310
published_at: "2019-06-19"
canonical_url: "https://postgresweekly.com/issues/310"
---

The latest Postgres news, articles, tools, and projects.       

#310 — June 19, 2019 

[Read on the Web](https://postgresweekly.com/issues/310)   

Postgres Weekly   

[Easily Running Postgres on a 'Per-Project' Basis](https://jamey.thesharps.us/2019/05/29/per-project-postgres/) — _“I worked out how to set up a Postgres database that’s almost as convenient as SQLite.”_ The goal was to make it as easy as typing `postgres` in a project folder to get a Postgres instance running solely for that project. How? Using `direnv` to handle the environment and the Nix package manager (so Linux and macOS only). 

Jamey Sharp   

[Another Look at Bloom Indexes in Postgres](https://www.percona.com/blog/2019/06/14/bloom-indexes-in-postgresql/) — Last week we linked to [Egor Rogov’s look at bloom indexes](https://habr.com/en/company/postgrespro/blog/452968/) but this is a more accessible introduction if the bloom filter data structure is new to you. 

Avinash Vallarapu   [![\](https://copm.s3.amazonaws.com/09a3e2fa.png)](https://postgreslondon.org) 

[PostgresLondon - Last Chance to Register 🐘](https://postgreslondon.org) — Join us in London for the evolution of PGConf UK to learn more about recent achievements & exciting future developments in PostgreSQL. You can also participate in hands-on training with experts covering: PostgreSQL Security & Multi-master Replication. 

PostgreSQL Events sponsor   

[Timescale Unveils Timescale Cloud: A Managed Time-Series Database Service](https://blog.timescale.com/timescale-cloud-first-fully-managed-time-series-database-service-runs-on-aws-gcp-azure/) — Why is this Postgres news? As well as now being a managed cloud service, [TimescaleDB](https://github.com/timescale/timescaledb) is an open source Postgres extension for working with time-series data at scale. 

Jeff Sposetti and Ajay Kulkarni   

[Linear Interpolation with SQL](https://bytefish.de/blog/postgresql_interpolation/) — A practical look at what you can do if you have a chronological data set with missing values. How can you find gaps and then how can you attempt to fill those gaps? 

Philipp Wagner   

[An Overview of Postgres to MySQL Cross Replication](https://severalnines.com/blog/overview-postgresql-mysql-cross-replication) — A detailed account of achieving cross replication between MySQL and Postgres databases using two different tools: pg_chameleon (a Postgres-specific system) and SymmetricDS (a database agnostic tool). 

Nawaz Ahmed   

[Checking the Status of Sequences in a Single Pass](https://fluca1978.github.io/2019/06/11/SequenceCheck.html) — A look at a function that collects together information about your sequences from the `pg_sequence`catalog. 

Luca Ferrari   

[Metrics to Monitor in Your PostgreSQL Database](https://www.influxdata.com/blog/metrics-to-monitor-in-your-postgresql-database/?utm_campaign=postgres&utm_medium=newsletter&utm_source=cooperpress) — There are several key metrics you’ll want to keep track of when it comes to database performance, and they’re not all database-specific. 

InfluxData sponsor   

[PG Reloaded: A CLI Tool to Restore Postgres Databases Periodically](https://github.com/zikani03/pg_reloaded) 

Zikani Nyirenda Mwase   

[A List of Databases Derived from Postgres](https://wiki.postgresql.org/wiki/PostgreSQL_derived_databases) 

PostgreSQL Wiki      supported by [![pganalyze\](https://res.cloudinary.com/cpress/image/upload/v1556537501/vj7gecocdfgw7iqaqmae.png)](https://pganalyze.com/ebooks/monitoring-postgres-logs?utm_source=PostgresWeeklyContent)  

💡 Tip of the Week 

The `LIKE` option on `CREATE TABLE` 

You've probably heard of [table inheritance](https://www.postgresql.org/docs/10/tutorial-inheritance.html) but what if you want something that's not quite so closely coupled.. let's say you just want to create a table that has the same columns as another? 

Enter the `LIKE` option on `CREATE TABLE`. It works like this:  

# create table people (name text, age integer);
 # create table people2 (LIKE people)
 # \d people2
 
 Table "public.people2"
 Column | Type 
 --------+---------
 name | text 
 age | integer   

That's the most basic example but it goes a lot further than that. For example, let's say you have indexes, constraints, comments or storage settings defined on the first table. You can specify whether you want to include `ALL` of these or just individual ones:  

# create table people3 (LIKE people INCLUDING ALL)
 # create table people4 (LIKE people INCLUDING INDEXES)   

You can also use `LIKE` to include columns while adding others of your own choice. For example:  

# create table people5 (LIKE people, city text);   

For more info on this feature check out the `like_option` section of the [CREATE TABLE](https://www.postgresql.org/docs/9.1/sql-createtable.html) documentation. 

This week's tip is sponsored by [pganalyze](https://pganalyze.com/?utm_source=PostgresWeeklyContent). DBAs and developers use pganalyze to identify the root cause of performance issues in their Postgres database, to optimize queries and to get alerts about critical issues.      

🗓 Upcoming Postgres Events 

- [Postgres Vision 2019](https://postgresvision.com/) (June 24-26 in Boston, MA) — Sir Tim Berners-Lee, the inventor of the Web, is delivering the keynote.
- [PostgresLondon 2019](https://postgreslondon.org/) (July 2-3 in London, UK)
- [PostgresConf Beijing 2019](https://postgresconf.org/conferences/Beijing) (July 3-6 in Beijing, China)
- [PGConf.Brasil 2019](https://www.pgconf.com.br/2019/en/) (August 1-3 in São Paulo) — A three day PG conference with talks, tutorials, courses, Couch Clinic, and lightning talks.
- [PGDay Austria 2019](https://pgday.at/en/) (September 6 in Wiener Neustadt, Austria)          

Curated by [Cooperpress](https://cooperpress.com/) and [Craig Kerstiens](https://twitter.com/craigkerstiens). 

[Change your email address](https://postgresweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
