{"id":9716,"date":"2017-01-27T21:51:01","date_gmt":"2017-01-27T20:51:01","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/"},"modified":"2023-06-08T16:17:27","modified_gmt":"2023-06-08T14:17:27","slug":"temporal-tables-with-postgresql","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/","title":{"rendered":"Temporal tables with PostgreSQL"},"content":{"rendered":"<p><strong>By Mouhamadou Diaw<\/strong><\/p>\n<p>In this blog we are going to talk about a nice extension in PostgreSQL: <span style=\"color: #ea6d14\">temporal_tables<\/span>. This extension provides support for temporal tables.<br \/>\nWhat is a temporal table? Just a table that tracks the period of validity of a row.<br \/>\nWhen implemented, this feature allows you to specify that old rows are archived into another table (that is called the history table). This can be useful for many purposes<br \/>\n-Audit<br \/>\n-Comparison<br \/>\n-Checking table state in the past<br \/>\nFirst we have to install the temporal_table extension. We are going to use the pgxn client to install the extension.<br \/>\nInstall the yum repository for PostgreSQL<br \/>\n<code><br \/>\n[root@pgserver1 ~]# rpm -ivh https:\/\/download.postgresql.org\/pub\/repos\/yum\/9.6\/redhat\/rhel-7-x86_64\/pgdg-oraclelinux96-9.6-3.noarch.rpm<br \/>\nRetrieving https:\/\/download.postgresql.org\/pub\/repos\/yum\/9.6\/redhat\/rhel-7-x86_64\/pgdg-oraclelinux96-9.6-3.noarch.rpm<br \/>\nwarning: \/var\/tmp\/rpm-tmp.3q9X12: Header V4 DSA\/SHA1 Signature, key ID 442df0f8: NOKEY<br \/>\nPreparing...                          ################################# [100%]<br \/>\nUpdating \/ installing...<br \/>\n1:pgdg-oraclelinux96-9.6-3         ################################# [100%]<br \/>\n[root@pgserver1 ~]#<br \/>\n<\/code><br \/>\nAnd after we install the pgxn client<br \/>\n<code><br \/>\nroot@pgserver1 ~]# yum search pgxn<br \/>\nLoaded plugins: langpacks, ulninfo<br \/>\npgdg96                                                                                               | 4.1 kB  00:00:00<br \/>\n(1\/2): pgdg96\/7Server\/x86_64\/group_gz                                                                |  249 B  00:00:00<br \/>\n(2\/2): pgdg96\/7Server\/x86_64\/primary_db                                                              | 127 kB  00:00:00<br \/>\n==================================================== N\/S matched: pgxn =====================================================<br \/>\npgxnclient.x86_64 : Command line tool designed to interact with the PostgreSQL Extension Network<br \/>\nName and summary matches only, use \"search all\" for everything.<br \/>\n<\/code><br \/>\n<code><br \/>\n[root@pgserver1 ~]# yum install pgxnclient.x86_64<br \/>\nLoaded plugins: langpacks, ulninfo<br \/>\nResolving Dependencies<br \/>\n--&gt; Running transaction check<br \/>\n---&gt; Package pgxnclient.x86_64 0:1.2.1-2.rhel7 will be installed<br \/>\n....<br \/>\n....<br \/>\nInstalled:<br \/>\npgxnclient.x86_64 0:1.2.1-2.rhel7<br \/>\nComplete!<br \/>\n[root@pgserver1 ~]#<br \/>\n<\/code><br \/>\nAnd finally we can install the extension<br \/>\n<code><br \/>\n[root@pgserver1 ~]#  pgxn install temporal_tables --pg_config=\/u01\/app\/PostgreSQL\/9.6\/bin\/pg_config<br \/>\nINFO: best version: temporal_tables 1.1.1<br \/>\nINFO: saving \/tmp\/tmpJit39m\/temporal_tables-1.1.1.zip<br \/>\nINFO: unpacking: \/tmp\/tmpJit39m\/temporal_tables-1.1.1.zip<br \/>\nINFO: building extension<br \/>\ngcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic -I. -I.\/ -I\/u01\/app\/PostgreSQL\/9.6\/include\/postgresql\/server -I\/u01\/app\/PostgreSQL\/9.6\/include\/postgresql\/internal -D_GNU_SOURCE  -I\/opt\/local\/Current\/include\/libxml2 -I\/opt\/local\/Current\/include  -c -o temporal_tables.o temporal_tables.c<br \/>\ngcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic -I. -I.\/ -I\/u01\/app\/PostgreSQL\/9.6\/include\/postgresql\/server -I\/u01\/app\/PostgreSQL\/9.6\/include\/postgresql\/internal -D_GNU_SOURCE  -I\/opt\/local\/Current\/include\/libxml2 -I\/opt\/local\/Current\/include  -c -o versioning.o versioning.c<br \/>\ngcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -DMAP_HUGETLB=0x40000 -fpic -shared -o temporal_tables.so temporal_tables.o versioning.o -L\/u01\/app\/PostgreSQL\/9.6\/lib -L\/opt\/local\/Current\/lib -Wl,--as-needed -Wl,-rpath,'\/u01\/app\/PostgreSQL\/9.6\/lib',--enable-new-dtags<br \/>\nINFO: installing extension<br \/>\n\/bin\/mkdir -p '\/u01\/app\/PostgreSQL\/9.6\/lib\/postgresql'<br \/>\n\/bin\/mkdir -p '\/u01\/app\/PostgreSQL\/9.6\/share\/postgresql\/extension'<br \/>\n\/bin\/mkdir -p '\/u01\/app\/PostgreSQL\/9.6\/share\/postgresql\/extension'<br \/>\n\/bin\/mkdir -p '\/u01\/app\/PostgreSQL\/9.6\/doc\/postgresql\/extension'<br \/>\n\/usr\/bin\/install -c -m 755  temporal_tables.so '\/u01\/app\/PostgreSQL\/9.6\/lib\/postgresql\/temporal_tables.so'<br \/>\n\/usr\/bin\/install -c -m 644 .\/\/temporal_tables.control '\/u01\/app\/PostgreSQL\/9.6\/share\/postgresql\/extension\/'<br \/>\n\/usr\/bin\/install -c -m 644 .\/\/temporal_tables--1.1.1.sql .\/\/temporal_tables--1.0.0--1.0.1.sql .\/\/temporal_tables--1.0.1--1.0.2.sql .\/\/temporal_tables--1.0.2--1.1.0.sql .\/\/temporal_tables--1.1.0--1.1.1.sql  '\/u01\/app\/PostgreSQL\/9.6\/share\/postgresql\/extension\/'<br \/>\n\/usr\/bin\/install -c -m 644 .\/\/README.md '\/u01\/app\/PostgreSQL\/9.6\/doc\/postgresql\/extension\/'<br \/>\n[root@pgserver1 ~]#<br \/>\n<\/code><br \/>\nOnce the installation done, we can load it in our database.<br \/>\n<code><br \/>\n[postgres@pgserver1 extension]$ psql<br \/>\nPassword:<br \/>\npsql.bin (9.6.1)<br \/>\nType \"help\" for help.<br \/>\npostgres=# CREATE EXTENSION temporal_tables;<br \/>\nCREATE EXTENSION<br \/>\npostgres=#<br \/>\n<\/code><br \/>\nWe can then verify that the temporal extension is now present in our database.<br \/>\n<code><br \/>\npostgres=# dx<br \/>\nList of installed extensions<br \/>\nName       | Version |   Schema   |               Description<br \/>\n-----------------+---------+------------+-----------------------------------------<br \/>\nadminpack       | 1.0     | pg_catalog | administrative functions for PostgreSQL<br \/>\nplpgsql         | 1.0     | pg_catalog | PL\/pgSQL procedural language<br \/>\ntemporal_tables | 1.1.1   | public     | temporal tables<br \/>\n(3 rows)<\/code><\/p>\n<p><code><br \/>\n<\/code><\/p>\n<p><code>postgres=# dx+ temporal_tables<br \/>\nObjects in extension \"temporal_tables\"<br \/>\nObject Description<br \/>\n----------------------------------------------------<br \/>\nfunction set_system_time(timestamp with time zone)<br \/>\nfunction versioning()<br \/>\n(2 rows)<br \/>\n<\/code><br \/>\nFor the demonstration, we create the following table Customers<br \/>\n<code><br \/>\nCREATE TABLE Customers (<br \/>\nCustNo   SERIAL NOT NULL,<br \/>\nCustName VARCHAR(30) NOT NULL,<br \/>\nstart_date timestamp NOT NULL DEFAULT now(),<br \/>\nPRIMARY KEY (CustNo)<br \/>\n);<br \/>\n<\/code><br \/>\nIn order to make this table system-period temporal table we should first add a system period column<br \/>\n<code><br \/>\npostgres=# ALTER TABLE Customers  ADD COLUMN sys_period tstzrange NOT NULL;<br \/>\nALTER TABLE<br \/>\n<\/code><br \/>\nThen we need a history table that contains archived rows of our table. The easiest way to create it is by using LIKE statement<br \/>\n<code><br \/>\npostgres=# CREATE TABLE Customers_history (LIKE Customers);<br \/>\nCREATE TABLE<br \/>\n<\/code><br \/>\nFinally we create a trigger on our table to link it with the history table<br \/>\n<code><br \/>\npostgres=# CREATE TRIGGER customers_hist_trigger BEFORE INSERT OR UPDATE OR DELETE ON Customers FOR EACH ROW<br \/>\nEXECUTE PROCEDURE versioning('sys_period', 'Customers_history', true);<br \/>\nCREATE TRIGGER<br \/>\npostgres=#<br \/>\n<\/code><br \/>\nNow Let\u2019s insert data into customers<br \/>\n<code><br \/>\ninsert into customers (custname,start_date) values ('HP','2013-08-05 00:00:00');<br \/>\ninsert into customers (custname,start_date) values ('IBM','2014-10-10 00:00:00');<br \/>\ninsert into customers (custname,start_date) values ('DBI','2017-01-07 00:00:00');<br \/>\ninsert into customers (custname) values ('DHL');<br \/>\n<\/code><br \/>\nWe can see below rows in customers.<br \/>\nFor example the row concerning IBM was inserted on 2017-01-26 10:48:49. Information stored in the sys_period column and represents the starting validity of the row. Note the borders <span style=\"color: #ea6d14\">[,)<\/span>. The lower bound is <span style=\"color: #ea6d14\">[ <\/span>and thus inclusive. The upper bound is <span style=\"color: #ea6d14\">)<\/span> which means it is exclusive.<br \/>\nFor IBM [&#8220;2017-01-26 10:48:49.768031+01&#8221;,) means<br \/>\nStart of validity: 2017-01-26 10:48:49.<br \/>\nEnd of validity: infinity (because there is nothing).<br \/>\n<code><br \/>\npostgres=# table customers;<br \/>\ncustno | custname |         start_date         |             sys_period<br \/>\n--------+----------+----------------------------+------------------------------------<br \/>\n1 | IBM      | 2014-10-10 00:00:00        | [\"2017-01-26 10:48:49.768031+01\",)<br \/>\n2 | DBI      | 2017-01-07 00:00:00        | [\"2017-01-26 10:48:49.778487+01\",)<br \/>\n3 | DHL      | 2017-01-26 10:48:49.841405 | [\"2017-01-26 10:48:49.841405+01\",)<br \/>\n4 | HP       | 2013-08-05 00:00:00        | [\"2017-01-26 10:50:21.275201+01\",)<br \/>\n(4 rows)<br \/>\n<\/code><br \/>\nThe table Customers_history is empty. This is normal because no update or delete are done, just we have inserted rows.<br \/>\n<code><br \/>\npostgres=# table customers_history;<br \/>\ncustno | custname | start_date | sys_period<br \/>\n--------+----------+------------+------------<br \/>\n(0 rows)<br \/>\npostgres=#<br \/>\n<\/code><br \/>\nLet\u2019s do an update on customers, but before let\u2019s display the current time.<br \/>\n<code> postgres=# select now();<br \/>\nnow<br \/>\n-------------------------------<br \/>\n2017-01-26 11:02:32.381634+01<br \/>\n(1 row)<br \/>\n<\/code><br \/>\n<code><br \/>\npostgres=# update customers set custname='HPSuisse' where custno=4;<br \/>\nUPDATE 1<br \/>\npostgres=#<br \/>\n<\/code><br \/>\nVerifying again the customers table, we can see that the validity of row concerning HPsuisse starts at 2017-01-26 11:02:46<br \/>\n<code><br \/>\npostgres=# table customers;<br \/>\ncustno | custname |         start_date         |             sys_period<br \/>\n--------+----------+----------------------------+------------------------------------<br \/>\n1 | IBM      | 2014-10-10 00:00:00        | [\"2017-01-26 10:48:49.768031+01\",)<br \/>\n2 | DBI      | 2017-01-07 00:00:00        | [\"2017-01-26 10:48:49.778487+01\",)<br \/>\n3 | DHL      | 2017-01-26 10:48:49.841405 | [\"2017-01-26 10:48:49.841405+01\",)<br \/>\n4 | HPSuisse | 2013-08-05 00:00:00        | [\"2017-01-26 11:02:46.347574+01\",)<br \/>\n(4 rows)<br \/>\n<\/code><br \/>\nIf we now query the table customers_history, we can see the row updated on the table customers with the validity of the row.<br \/>\n<code><br \/>\npostgres=# table customers_history;<br \/>\ncustno | custname |     start_date      |                            sys_period<br \/>\n--------+----------+---------------------+-------------------------------------------------------------------<br \/>\n4 | HP       | 2013-08-05 00:00:00 | [\"2017-01-26 10:50:21.275201+01\",\"2017-01-26 11:02:46.347574+01\")<br \/>\n<\/code><br \/>\nLet\u2019s do a delete on the table customers<br \/>\n<code><br \/>\npostgres=# select now();<br \/>\nnow<br \/>\n-------------------------------<br \/>\n2017-01-26 11:32:12.229105+01<br \/>\n(1 row)<br \/>\n<\/code><br \/>\n<code><br \/>\npostgres=# delete from customers where custno=3;<br \/>\nDELETE 1<br \/>\n<\/code><br \/>\nBelow rows in table customers<br \/>\n<code><br \/>\npostgres=# table customers;<br \/>\ncustno | custname |     start_date      |             sys_period<br \/>\n--------+----------+---------------------+------------------------------------<br \/>\n1 | IBM      | 2014-10-10 00:00:00 | [\"2017-01-26 10:48:49.768031+01\",)<br \/>\n2 | DBI      | 2017-01-07 00:00:00 | [\"2017-01-26 10:48:49.778487+01\",)<br \/>\n4 | HPSuisse | 2013-08-05 00:00:00 | [\"2017-01-26 11:02:46.347574+01\",)<br \/>\n(3 rows)<br \/>\n<\/code><br \/>\nAnd in the history table, we can see a new row with the validity date.<br \/>\n<code><br \/>\npostgres=# table customers_history;<br \/>\ncustno | custname |         start_date         |                            sys_period<br \/>\n--------+----------+----------------------------+-------------------------------------------------------------------<br \/>\n4 | HP       | 2013-08-05 00:00:00        | [\"2017-01-26 10:50:21.275201+01\",\"2017-01-26 11:02:46.347574+01\")<br \/>\n3 | DHL      | 2017-01-26 10:48:49.841405 | [\"2017-01-26 10:48:49.841405+01\",\"2017-01-26 11:32:15.370438+01\")<br \/>\n(2 rows)<br \/>\n<\/code><br \/>\n<b>Conclusion<\/b><br \/>\nIn this blog we see how temporal tables can be implemented with PostgreSQL using extention temporal_table. This feature can help for auditing, archiving,&#8230;<br \/>\nAnd the history table can be moved to lower storage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Mouhamadou Diaw In this blog we are going to talk about a nice extension in PostgreSQL: temporal_tables. This extension provides support for temporal tables. What is a temporal table? Just a table that tracks the period of validity of a row. When implemented, this feature allows you to specify that old rows are archived [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[378,586,1026],"type_dbi":[],"class_list":["post-9716","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-extension","tag-postegresql","tag-temporal-tables"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Temporal tables with PostgreSQL - dbi Blog<\/title>\n<meta name=\"description\" content=\"PostegreSQL, extension, temporal tables\" \/>\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-with-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Temporal tables with PostgreSQL\" \/>\n<meta property=\"og:description\" content=\"PostegreSQL, extension, temporal tables\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-27T20:51:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-08T14:17:27+00:00\" \/>\n<meta name=\"author\" content=\"Oracle Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oracle Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 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-with-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"Temporal tables with PostgreSQL\",\"datePublished\":\"2017-01-27T20:51:01+00:00\",\"dateModified\":\"2023-06-08T14:17:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/\"},\"wordCount\":435,\"commentCount\":0,\"keywords\":[\"Extension\",\"PostegreSQL\",\"temporal tables\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/\",\"name\":\"Temporal tables with PostgreSQL - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2017-01-27T20:51:01+00:00\",\"dateModified\":\"2023-06-08T14:17:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/66ab87129f2d357f09971bc7936a77ee\"},\"description\":\"PostegreSQL, extension, temporal tables\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/temporal-tables-with-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Temporal tables with PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"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\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/66ab87129f2d357f09971bc7936a77ee\",\"name\":\"Oracle Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"caption\":\"Oracle Team\"},\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/oracle-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Temporal tables with PostgreSQL - dbi Blog","description":"PostegreSQL, extension, temporal tables","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-with-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"Temporal tables with PostgreSQL","og_description":"PostegreSQL, extension, temporal tables","og_url":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/","og_site_name":"dbi Blog","article_published_time":"2017-01-27T20:51:01+00:00","article_modified_time":"2023-06-08T14:17:27+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"Temporal tables with PostgreSQL","datePublished":"2017-01-27T20:51:01+00:00","dateModified":"2023-06-08T14:17:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/"},"wordCount":435,"commentCount":0,"keywords":["Extension","PostegreSQL","temporal tables"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/","url":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/","name":"Temporal tables with PostgreSQL - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2017-01-27T20:51:01+00:00","dateModified":"2023-06-08T14:17:27+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"description":"PostegreSQL, extension, temporal tables","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/temporal-tables-with-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Temporal tables with PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","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":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee","name":"Oracle Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","caption":"Oracle Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9716","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\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=9716"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9716\/revisions"}],"predecessor-version":[{"id":25691,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9716\/revisions\/25691"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9716"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=9716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}