【问题标题】:Does Heroku currently support the postgresql temporal tables extension?Heroku 目前是否支持 postgresql 时态表扩展?
【发布时间】:2015-10-08 20:12:30
【问题描述】:

在 heroku 文档中找不到任何提及它的内容。我正在考虑创建一个历史表并想知道。如此处所述:https://github.com/arkhipov/temporal_tables 和此处http://clarkdave.net/2015/02/historical-records-with-postgresql-and-temporal-tables-and-sql-2011/

【问题讨论】:

  • 在阅读了一些关于临时表的文档后,它们与常规表没有什么不同。我不明白为什么 heroku 会有任何问题
  • 我投票结束这个问题,因为它不是关于编程,而是关于工具的功能

标签: postgresql heroku heroku-postgres


【解决方案1】:

据我所知,Heroku 的 Postgres 服务不包含该特定扩展:

SELECT * FROM pg_available_extensions WHERE name LIKE '%temporal%';
...
(0 rows)

以下是可用扩展的完整列表(截至 2015 年 7 月 20 日):

SELECT * FROM pg_available_extensions;

         name          | default_version | installed_version |                               comment
------------------------+-----------------+-------------------+----------------------------------------------------------------------
 dblink                 | 1.1             | [null]            | connect to other PostgreSQL databases from within a database
 tablefunc              | 1.0             | [null]            | functions that manipulate whole tables, including crosstab
 hstore                 | 1.3             | [null]            | data type for storing sets of (key, value) pairs
 intarray               | 1.0             | [null]            | functions, operators, and index support for 1-D arrays of integers
 pg_trgm                | 1.1             | [null]            | text similarity measurement and index searching based on trigrams
 postgis                | 2.1.7           | [null]            | PostGIS geometry, geography, and raster spatial types and functions
 pg_stat_statements     | 1.2             | [null]            | track execution statistics of all SQL statements executed
 test_parser            | 1.0             | [null]            | example of a custom parser for full-text search
 dict_xsyn              | 1.0             | [null]            | text search dictionary template for extended synonym processing
 insert_username        | 1.0             | [null]            | functions for tracking who changed a table
 pg_freespacemap        | 1.0             | [null]            | examine the free space map (FSM)
 ltree                  | 1.0             | [null]            | data type for hierarchical tree-like structures
 test_shm_mq            | 1.0             | [null]            | Test code for shared memory message queues
 adminpack              | 1.0             | [null]            | administrative functions for PostgreSQL
 plpgsql                | 1.0             | 1.0               | PL/pgSQL procedural language
 plv8                   | 1.4.2           | [null]            | PL/JavaScript (v8) trusted procedural language
 dict_int               | 1.0             | [null]            | text search dictionary template for integers
 fuzzystrmatch          | 1.0             | [null]            | determine similarities and distance between strings
 tcn                    | 1.0             | [null]            | Triggered change notifications
 sslinfo                | 1.0             | [null]            | information about SSL certificates
 lo                     | 1.0             | [null]            | Large Object maintenance
 cube                   | 1.0             | [null]            | data type for multidimensional cubes
 tsearch2               | 1.0             | [null]            | compatibility package for pre-8.3 text search functions
 timetravel             | 1.0             | [null]            | functions for implementing time travel
 redis_fdw              | 1.0             | [null]            | Foreign data wrapper for querying a Redis server
 pgstattuple            | 1.2             | [null]            | show tuple-level statistics
 earthdistance          | 1.0             | [null]            | calculate great-circle distances on the surface of the Earth
 chkpass                | 1.0             | [null]            | data type for auto-encrypted passwords
 refint                 | 1.0             | [null]            | functions for implementing referential integrity (obsolete)
 moddatetime            | 1.0             | [null]            | functions for tracking last modification time
 seg                    | 1.0             | [null]            | data type for representing line segments or floating-point intervals
 pageinspect            | 1.2             | [null]            | inspect the contents of database pages at a low level
 citext                 | 1.0             | [null]            | data type for case-insensitive character strings
 autoinc                | 1.0             | [null]            | functions for autoincrementing fields
 pg_prewarm             | 1.0             | [null]            | prewarm relation data
 isn                    | 1.0             | [null]            | data types for international product numbering standards
 postgis_topology       | 2.1.7           | [null]            | PostGIS topology spatial types and functions
 xml2                   | 1.0             | [null]            | XPath querying and XSLT
 postgres_fdw           | 1.0             | [null]            | foreign-data wrapper for remote PostgreSQL servers
 postgis_tiger_geocoder | 2.1.7           | [null]            | PostGIS tiger geocoder and reverse geocoder
 unaccent               | 1.0             | [null]            | text search dictionary that removes accents
 pg_buffercache         | 1.0             | [null]            | examine the shared buffer cache
 uuid-ossp              | 1.0             | 1.0               | generate universally unique identifiers (UUIDs)
 file_fdw               | 1.0             | [null]            | foreign-data wrapper for flat file access
 pg_logfebe             | 1.0             | [null]            | log via febe framing protocol to a unix socket
 btree_gist             | 1.0             | [null]            | support for indexing common datatypes in GiST
 pgcrypto               | 1.1             | [null]            | cryptographic functions
 intagg                 | 1.0             | [null]            | integer aggregator and enumerator (obsolete)
 pgrowlocks             | 1.1             | [null]            | show row-level locking information
 btree_gin              | 1.0             | [null]            | support for indexing common datatypes in GIN
 worker_spi             | 1.0             | [null]            | Sample background worker

亚马逊的 RDS 也 doesn't appear 包含它。

不过并不完全令人惊讶:这是一个有趣的扩展,但不太可能经常被请求(因为可以间接复制该功能)。

【讨论】:

  • 来自 heroku 帮助:“您好,恐怕没有,我们只是启用了这些扩展(而且有些仅在标准和高级层中可用)。虽然它看起来像一个非常简洁的扩展,我会将其转发给我们的 Postgres 团队以供考虑。感谢您抽出宝贵的时间来写信。问候,Steven"
【解决方案2】:

在 PL/pgSQL 中有一个 temporal_tables 的实现,它不需要编译扩展。这应该适用于任何托管的 PostgresSQL 数据库,例如 Heroku Postgres。

Github 项目:https://github.com/nearform/temporal_tables

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-21
    • 1970-01-01
    • 2012-02-24
    • 2014-02-06
    • 1970-01-01
    • 2015-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多