{"id":16671,"date":"2021-08-26T14:00:38","date_gmt":"2021-08-26T12:00:38","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/"},"modified":"2021-08-26T14:00:38","modified_gmt":"2021-08-26T12:00:38","slug":"temporal-tables-for-postgresql-15","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/","title":{"rendered":"Temporal tables for PostgreSQL 15?"},"content":{"rendered":"<p>One of the features which is currently missing in PostgreSQL is Temporal Tables. Other database systems have that since a long time and many people want to have in PostgreSQL as well. If you don&#8217;t know what it is, <a href=\"https:\/\/en.wikipedia.org\/wiki\/SQL:2011\" target=\"_blank\" rel=\"noopener\">here<\/a> is a short overview. Basically you can ask for a row as it was at a specific point in time. The <a href=\"https:\/\/www.postgresql.org\/message-id\/flat\/CALAY4q-cXCD0r4OybD%3Dw7Hr7F026ZUY6%3DLMsVPUe6yw_PJpTKQ%40mail.gmail.com\" target=\"_blank\" rel=\"noopener\">patch<\/a> which implements this, is currently in status <a href=\"https:\/\/commitfest.postgresql.org\/34\/2316\/\" target=\"_blank\" rel=\"noopener\">&#8220;Ready for Committer&#8221;<\/a>, which does not guarantee that it actually will be committed, but it should be in shape to test the functionality that comes with it.<\/p>\n<p>Having applied the patch and re-compiled PostgreSQL the feature can be tested. The most easy way to enable the feature for a table is this:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# create table t1 ( a int primary key generated always as identity\n                           , b text ) \n                           with system versioning;\nCREATE TABLE\npostgres=# d t1\n                                      Table \"public.t1\"\n  Column   |           Type           | Collation | Nullable |            Default            \n-----------+--------------------------+-----------+----------+-------------------------------\n a         | integer                  |           | not null | generated always as identity\n b         | text                     |           |          | \n starttime | timestamp with time zone |           | not null | generated always as row start\n endtime   | timestamp with time zone |           | not null | generated always as row end\nIndexes:\n    \"t1_pkey\" PRIMARY KEY, btree (a, endtime)\n<\/pre>\n<p>Two additional columns have been added automatically, starttime and endtime. If you don&#8217;t like the column names you can also do it like this:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# create table t2 ( a int primary key generated always as identity\n                           , b text\n                           , mystart timestamptz generated always as row start\n                           , myend timestamptz generated always as row end );\nCREATE TABLE\npostgres=# d t2\n                                     Table \"public.t2\"\n Column  |           Type           | Collation | Nullable |            Default            \n---------+--------------------------+-----------+----------+-------------------------------\n a       | integer                  |           | not null | generated always as identity\n b       | text                     |           |          | \n mystart | timestamp with time zone |           | not null | generated always as row start\n myend   | timestamp with time zone |           | not null | generated always as row end\nIndexes:\n    \"t2_pkey\" PRIMARY KEY, btree (a, myend)\n<\/pre>\n<p>Note that the two columns need to be defined as <a href=\"https:\/\/www.postgresql.org\/docs\/current\/datatype-datetime.html\" target=\"_blank\" rel=\"noopener\">timestamptz<\/a>:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# create table t3 ( a int primary key generated always as identity, b text, mystart date generated always as row start, myend date generated always as row end );\nERROR:  data type of row start time must be timestamptz\n<\/pre>\n<p>To see the feature in action lets add some data, fire an update and have a look at the history:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# insert into t1 (b) select md5(a::text) from generate_series(1,10) a;\nINSERT 0 10\npostgres=# update t1 set b = random()::text;\nUPDATE 10\npostgres=# select * from t1 for system_time from '-infinity' to 'infinity' order by a;\n a  |                b                 |           starttime           |            endtime            \n----+----------------------------------+-------------------------------+-------------------------------\n  1 | c4ca4238a0b923820dcc509a6f75849b | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  1 | 0.42111793538855835              | 2021-08-24 16:16:55.417076+02 | infinity\n  2 | c81e728d9d4c2f636f067f89cc14862c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  2 | 0.5479128803753532               | 2021-08-24 16:16:55.417076+02 | infinity\n  3 | eccbc87e4b5ce2fe28308fd9f2a7baf3 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  3 | 0.5512468293024142               | 2021-08-24 16:16:55.417076+02 | infinity\n  4 | a87ff679a2f3e71d9181a67b7542122c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  4 | 0.4112741522472554               | 2021-08-24 16:16:55.417076+02 | infinity\n  5 | e4da3b7fbbce2345d7772b0674a318d5 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  5 | 0.46017420469036807              | 2021-08-24 16:16:55.417076+02 | infinity\n  6 | 1679091c5a880faf6fb5e6087eb1b2dc | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  6 | 0.3495216613664702               | 2021-08-24 16:16:55.417076+02 | infinity\n  7 | 8f14e45fceea167a5a36dedd4bea2543 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  7 | 0.2657576876373895               | 2021-08-24 16:16:55.417076+02 | infinity\n  8 | c9f0f895fb98ab9159f51fd0297e236d | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  8 | 0.9808748465536858               | 2021-08-24 16:16:55.417076+02 | infinity\n  9 | 45c48cce2e2d7fbdea1afc51c7c6ad26 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  9 | 0.4533070845652887               | 2021-08-24 16:16:55.417076+02 | infinity\n 10 | d3d9446802a44259755d38e6d163e820 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n 10 | 0.20914767879762408              | 2021-08-24 16:16:55.417076+02 | infinity\n(20 rows)\n<\/pre>\n<p>The rows with &#8220;endtime = infinity&#8221; are the current ones, the ones with an actual endtime are historical versions. Doing the almost same thing again makes it more clear:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# update t1 set b = 'xxxxx';\nUPDATE 10\npostgres=# select * from t1 for system_time from '-infinity' to 'infinity' order by a, starttime;\n a  |                b                 |           starttime           |            endtime            \n----+----------------------------------+-------------------------------+-------------------------------\n  1 | c4ca4238a0b923820dcc509a6f75849b | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  1 | 0.42111793538855835              | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  1 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  2 | c81e728d9d4c2f636f067f89cc14862c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  2 | 0.5479128803753532               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  2 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  3 | eccbc87e4b5ce2fe28308fd9f2a7baf3 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  3 | 0.5512468293024142               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  3 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  4 | a87ff679a2f3e71d9181a67b7542122c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  4 | 0.4112741522472554               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  4 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  5 | e4da3b7fbbce2345d7772b0674a318d5 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  5 | 0.46017420469036807              | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  5 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  6 | 1679091c5a880faf6fb5e6087eb1b2dc | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  6 | 0.3495216613664702               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  6 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  7 | 8f14e45fceea167a5a36dedd4bea2543 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  7 | 0.2657576876373895               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  7 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  8 | c9f0f895fb98ab9159f51fd0297e236d | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  8 | 0.9808748465536858               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  8 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n  9 | 45c48cce2e2d7fbdea1afc51c7c6ad26 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  9 | 0.4533070845652887               | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  9 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n 10 | d3d9446802a44259755d38e6d163e820 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n 10 | 0.20914767879762408              | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n 10 | xxxxx                            | 2021-08-24 16:58:24.799322+02 | infinity\n(30 rows)\n<\/pre>\n<p>Without specifying any time frame you get the current version of rows, of course:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# select * from t1 order by a;\n a  |   b   |           starttime           | endtime  \n----+-------+-------------------------------+----------\n  1 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  2 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  3 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  4 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  5 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  6 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  7 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  8 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n  9 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n 10 | xxxxx | 2021-08-24 16:58:24.799322+02 | infinity\n<\/pre>\n<p>Asking for a specific point in time works as well:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# select * from t1 for system_time as of '2021-08-24 16:16:25.648976+02'::timestamptz;\n a  |                b                 |           starttime           |            endtime            \n----+----------------------------------+-------------------------------+-------------------------------\n  1 | c4ca4238a0b923820dcc509a6f75849b | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  2 | c81e728d9d4c2f636f067f89cc14862c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  3 | eccbc87e4b5ce2fe28308fd9f2a7baf3 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  4 | a87ff679a2f3e71d9181a67b7542122c | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  5 | e4da3b7fbbce2345d7772b0674a318d5 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  6 | 1679091c5a880faf6fb5e6087eb1b2dc | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  7 | 8f14e45fceea167a5a36dedd4bea2543 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  8 | c9f0f895fb98ab9159f51fd0297e236d | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n  9 | 45c48cce2e2d7fbdea1afc51c7c6ad26 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n 10 | d3d9446802a44259755d38e6d163e820 | 2021-08-24 16:16:25.648976+02 | 2021-08-24 16:16:55.417076+02\n<\/pre>\n<p>&#8230; or asking like this:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# select * from t1 for system_time between '2021-08-24 16:16:55.417076+02'::timestamptz and '2021-08-24 16:58:24.799322+02'::timestamptz;\n a  |          b          |           starttime           |            endtime            \n----+---------------------+-------------------------------+-------------------------------\n  1 | 0.42111793538855835 | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  1 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  2 | 0.5479128803753532  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  2 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  3 | 0.5512468293024142  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  3 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  4 | 0.4112741522472554  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  4 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  5 | 0.46017420469036807 | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  5 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  6 | 0.3495216613664702  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  6 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  7 | 0.2657576876373895  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  7 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  8 | 0.9808748465536858  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  8 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n  9 | 0.4533070845652887  | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n  9 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n 10 | 0.20914767879762408 | 2021-08-24 16:16:55.417076+02 | 2021-08-24 16:58:24.799322+02\n 10 | xxxxx               | 2021-08-24 16:58:24.799322+02 | infinity\n<\/pre>\n<p>Really looks promising. Thanks to all involved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the features which is currently missing in PostgreSQL is Temporal Tables. Other database systems have that since a long time and many people want to have in PostgreSQL as well. If you don&#8217;t know what it is, here is a short overview. Basically you can ask for a row as it was at&hellip;&nbsp;<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[],"class_list":["post-16671","post","type-post","status-publish","format-standard","category-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Temporal tables for PostgreSQL 15? - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Temporal tables for PostgreSQL 15?\" \/>\n<meta property=\"og:description\" content=\"One of the features which is currently missing in PostgreSQL is Temporal Tables. Other database systems have that since a long time and many people want to have in PostgreSQL as well. If you don&#8217;t know what it is, here is a short overview. Basically you can ask for a row as it was at&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T12:00:38+00:00\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\"},\"headline\":\"Temporal tables for PostgreSQL 15?\",\"datePublished\":\"2021-08-26T12:00:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/\"},\"wordCount\":245,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/\",\"name\":\"Temporal tables for PostgreSQL 15? - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-08-26T12:00:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-for-postgresql-15\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Temporal tables for PostgreSQL 15?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"caption\":\"Open source Team\"},\"description\":\"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/open-source-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Temporal tables for PostgreSQL 15? - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/","og_locale":"en_US","og_type":"article","og_title":"Temporal tables for PostgreSQL 15?","og_description":"One of the features which is currently missing in PostgreSQL is Temporal Tables. Other database systems have that since a long time and many people want to have in PostgreSQL as well. If you don&#8217;t know what it is, here is a short overview. Basically you can ask for a row as it was at&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2021-08-26T12:00:38+00:00","author":"Open source Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Open source Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a"},"headline":"Temporal tables for PostgreSQL 15?","datePublished":"2021-08-26T12:00:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/"},"wordCount":245,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/","url":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/","name":"Temporal tables for PostgreSQL 15? - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2021-08-26T12:00:38+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-for-postgresql-15\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Temporal tables for PostgreSQL 15?"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","caption":"Open source Team"},"description":"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.","url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=16671"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16671\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=16671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=16671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=16671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}