E.2. Release 11

E.2.1. 개요
E.2.2. 11 버전으로 마이그레이션
E.2.3. 바뀐점
E.2.4. Acknowledgments

출시일: 2018-10-18

E.2.1. 개요

PostgreSQL 11 주요 개선 사항:

  • 파티션 기능 개선 사항:

    • 해시 키 파티션 지원

    • 상위 파티션 테이블에 PRIMARY KEY, FOREIGN KEY, 인덱스, 트리거를 지정할 수 있음.

    • 어느 하위 파티션 테이블에도 저장할 수 없는 기타 자료를 저장하는 하위 default 파티션 테이블을 만들 수 있음.

    • 파티션 키 값 변경으로 해당 자료가 다른 하위 테이블로 옮겨지는 UPDATE 구문 허용

    • 쿼리 실행 계획과 실행에서 향상된 파티션 테이블 선택 전략을 사용해서 SELECT 명령 성능을 보다 좋게 함.

  • 병렬 처리 개선 사항:

    • B-tree 인덱스인 경우 CREATE INDEX 명령에서 병렬 작업을 함.

    • CREATE TABLE ... AS, CREATE MATERIALIZED VIEW, UNION 구문에서 병렬 작업을 함.

    • 해시 조인과 순차 탐색에서도 병렬 처리가 개선 됨.

  • 임베디드 트랜잭션을 지원하는 SQL 스토어드 프로시져

  • 몇몇 SQL 코드용 Just-in-Time (JIT) 짜깁기 compilation 기능을 선택할 수 있음. 표현식 검사 속도를 더 빠르게 함.

  • 윈도우 함수가 이제 SQL:2011 표준을 모두 지원함. RANGE distance PRECEDING/FOLLOWING, GROUPS 모드, 프레임 제외 옵션 기능을 지원함.

  • CREATE INDEX 구문에서 INCLUDE 절을 사용하여 커버링 인덱스 covering index 를 만들 수 있음.

  • ALTER TABLE ... ADD COLUMN 명령으로 not null default 값이 있는 칼럼을 추가 할 때 테이블 전체 다시 쓰기를 하지 않음. 그 외 많은 성능 개선.

위에서 언급한 각 항목들은 아래에서 다시 자세히 다룬다.

E.2.2. 11 버전으로 마이그레이션

이전 버전에서 사용하고 있던 자료를 계속 사용하려면, pg_dumpall 명령을 이용해서 자료를 덤프하고, 복원하거나, pg_upgrade 명령을 이용한다.

11 버전에서는 이전 버전과의 호환성 측면에서 영향을 줄 수 있는 변경 사항들이 많다. 아래 호환성 문제가 되는 부분을 잙 읽어야 한다:

  • 데이터베이스 속성 관련 덤프는 이제 pg_dump 명령으로 한다. (Haribabu Kommi)

    이전 버전에서는 데이터베이스 수준의 GRANT/REVOKE 접근 권한, ALTER DATABASE SET 명령으로 지정한 변수값과 같은 데이터베이스 자체의 속성들은 pg_dumpall 명령으로 덤프했다. 이제 pg_dump --create, pg_restore --create 명령이 그 일을 담당한다. pg_dumpall -g 명령은 이제, 롤 정보와 테이블스페이스 정보만 덤프한다. -g 옵션을 사용하지 않고, 그냥 pg_dumpall 명령을 사용할 때는 기존과 같이 작동한다.

    pg_dump, pg_restore 명령에서 --create 옵션을 사용하지 않으면, 이제는 데이터베이스 수준의 주석, 보안 라벨을 덤프/복원하지 않는다. 이들도 데이터베이스 속성과 같은 방식으로 처리한다.

    pg_dumpall 명령은 이제 데이터베이스를 만드는 구문을 만들 때, 그 데이터베이스의 로케일과 인코딩 설정도 포함한다. 새로 복원하려는 서버에서 이 로케일과 인코딩을 지원하지 않으면 복원 작업을 할 수 없다. 이전 버전에서는 클러스터의 기본 로케일과 인코딩과 같은 경우는 CREATE DATABASE 구문에서 이것을 생략했었다.

    pg_dumpall --clean 명령에서도 이 정책은 동일하다. 사용자가 만든 데이터베이스나, postgres, template1 데이터베이스도 기존 인코딩과 로케일 설정을 그대로 사용하도록 덤프 한다.

  • 함수와 칼럼 참조 사이 해석의 모호함이 생길 때 문법 양식을 고려한다. (Tom Lane)

    x가 테이블 이름이거나 복합자료형 이름인 경우, PostgreSQL에서는 전통적으로 f(x) 구문과, x.f 구문을 문법적으로 같은 것으로 처리한다. 즉, 문법 형식으로 보며, 마치 해당 칼럼 이름과 같은 함수가 있고, 그 인자로 테이블이나 복합 자료형을 사용하는 처럼 보인다. 이 때, 그 칼럼 이름이 이미 있는 함수 이름과 같은 경우 이전 버전에는 항상 그것을 칼럼으로 처리했으나, 이 버전부터는 구문 형식에 맞게 처리한다.

  • 테이블과 도메인의 제약 조건 이름이 이제 완벽한 유일성을 가진다. (Tom Lane)

    PostgreSQL에서는 하나의 테이블이나 도메인에 지정하는 제약 조건은 그 이름이 유일해야 하는데, 이전 버전까지는 중복된 이름의 제약 조건을 만들 수 있었다. 이 버전부터는 엄격하게 같은 이름의 제약조건을 만들 수 없도록 했다.

  • power(numeric, numeric), power(float8, float8) 함수에서 NaN 입력값 처리를 POSIX 표준으로 따르도록 고쳤다. (Tom Lane, Dang Minh Huong)

    POSIX에서는 NaN ^ 0 = 1, 1 ^ NaN = 1, 그 외 NaN 값을 입력으로하는 모든 결과값은 NaN 값으로 한다고 정하고 있다. 오래된 유닉스 플랫폼 라이브러리를 사용하거나, 몇 윈도우즈 버전에서는 이런 규약과 다르게 결과값을 반환했다. 이 부분을 수정했다.

  • to_number() 함수에서 템플릿 구분문자가 일치하지 않을 때 입력값이 사라지는 부분 방지함. (Oliver Ford)

    이전 버전에는 SELECT to_number('1234', '9,999') 명령 결과는 134이었다. 이 버전부터는 1234이다. 이제 L, TH 문자만 사라진다. 숫자, 양수/음수 기호, 소수점, 쉼표 위치의 숫자는 사라지지 않는다.

  • to_date(), to_number(), to_timestamp() 에서 사용하는 템플릿 문자열에서 숫자 아닌 문자가 멀티 바이트 문자인 경우도 한 문자로 처리한다. (Tom Lane)

    이전 버전까지는 이 문자는 1 바이트로 처리해서, 그 결과 같이 의도하지 않게 출력되었다. 이제는 멀티 바이트 문자인 경우도 한 문자로 처리한다.

  • to_char(), to_number(), to_timestamp() 함수에 사용하는 템플릿 문자열에서 큰 따옴표 안에 있는 백슬래시 문자 처리 정책 변경.

    큰 따옴표나, 다른 백슬래쉬 뒤에 오는 백슬래쉬는 이 버전부터 이케이프 처리를 한다.

  • xmltable(), xpath(), 기타 XML-처리 함수들에서 상대 경로 처리 정책 변경 (Markus Winand)

    SQL 표준에 따라, 상대 경로는 입력되는 XML 문서의 document 노드를 기준으로 처리한다. 이전 버전까지는 root 노드를 기준으로 처리했다.

  • 확장된 쿼리 프로토콜에서, statement_timeout 설정값은 모든 명령을 다 실행한 뒤가 아니라, 각 명령 실행에 대해 적용한다. (Tatsuo Ishii, Andres Freund)

  • pg_class 시스템 카탈로그에서 relhaspkey 칼럼이 빠졌다. (Peter Eisentraut)

    이제 기본키 속성 검색은 pg_index 테이블을 참조한다.

  • pg_proc 시스템 카탈로그에서 proisagg, proiswindow 두 칼럼은 prokind 칼럼으로 통합되었다. (Peter Eisentraut)

    함수, 프로시져, 집계 함수, 윈도우 함수 등 구분을 한 칼럼으로 처리한다.

  • 외부 테이블에 대한 information 스키마 tables.table_type 칼럼 값이 FOREIGN TABLE에서 FOREIGN으로 바뀌었다. (Peter Eisentraut)

    SQL 표준을 따른다.

  • ps 명령에서 프로세스 이름을 pg_stat_activity.backend_type 칼럼 값과 맞췄다. (Peter Eisentraut)

  • 대형 개체 사용을 위한 lo_open() 함수 사용에서 접근 권한 검사를 한다. 이전에는 이 개체를 읽거나 쓸 때 접근 권한 검사를 했었다. (Tom Lane, Michael Paquier)

    쓰기 접근이 요청되었으나 불가능한 경우, 그 대형 개체 쓰기 작업을 하지 않는다 하더라도 오류로 처리한다.

  • 공유되는 카탈로그의 reindex 작업은 슈퍼유저만 허용하도록 변경함. (Michael Paquier, Robert Haas)

    이전 버전에는 해당 데이터베이스 소유주도 이 작업을 할 수 있었으나, 이번 버전부터 권한 정책을 바꿨다.

  • adminpack 확장 모듈에 있었던 pg_file_read(), pg_file_length(), pg_logfile_rotate() 함수를 없앴다. (Stephen Frost)

    이 함수들은 이미 내장 함수로 제공하고 있다. adminpack 모듈 소속 함수를 제거하려면, ALTER EXTENSION ... UPDATE 명령을 이용해서 해당 모듈을 업데이트하면 된다.

  • 옵션 이름으로 큰 따옴표를 사용한 대소문자를 구분하는 이름을 허용한다. (Daniel Gustafsson)

    이전 버전까지 옵션 이름은 모두 소문자를 사용해야 했었다. 이제 "FillFactor" 같이 대소문자를 구분 하는 경우는 큰따옴표를 사용한다. 물론 이렇게 사용하면 오류로 처리한다. (fillfactor 옵션 이름은 모두 소문자다.)

  • 서버 매개변수 replacement_sort_tuples 삭제. (Peter Geoghegan)

    Replacement sort 기능이 더 이상 유용하지 않다고 결정했다.

  • CREATE FUNCTION 구문에서 WITH 절이 빠졌다. (Michael Paquier)

    이번 PostgreSQL 버전에서 표준 호환성 준수에 따라 이 구문을 뺐다.

E.2.3. 바뀐점

다음에서 PostgreSQL 11과 이전 메이저 버전 사이 바뀐 부분들을 소개한다.

E.2.3.1. 서버

E.2.3.1.1. 파티션
  • 파티션 키로 해시 키를 사용할 수 있음. (Amul Sul)

  • 상위 파티션 테이블에 인덱스 지정할 수 있음 (Álvaro Herrera, Amit Langote)

    상위 파티션 테이블에 지정한 인덱스는 하위 테이블을 전체 자료를 대상으로 하는 물리적인 인덱스가 아니라, 각 하위 테이블에서 자동으로 만들어질 인덱스에 대한 일종의 템플릿 정의다.

    If the partition key is part of the index's column set, a partitioned index may be declared UNIQUE. It will represent a valid uniqueness constraint across the whole partitioned table, even though each physical index only enforces uniqueness within its own partition.

    The new command ALTER INDEX ATTACH PARTITION causes an existing index on a partition to be associated with a matching index template for its partitioned table. This provides flexibility in setting up a new partitioned index for an existing partitioned table.

  • 상위 파티션 테이블에 참조 키를 지정할 수 있음 (Álvaro Herrera)

  • 상위 파티션 테이블에 FOR EACH ROW 트리거를 지정할 수 있음 (Álvaro Herrera)

    Creation of a trigger on a partitioned table automatically creates triggers on all existing and future partitions. This also allows deferred unique constraints on partitioned tables.

  • Allow partitioned tables to have a default partition (Jeevan Ladhe, Beena Emerson, Ashutosh Bapat, Rahila Syed, Robert Haas)

    The default partition will store rows that don't match any of the other defined partitions, and is searched accordingly.

  • UPDATE statements that change a partition key column now cause affected rows to be moved to the appropriate partitions (Amit Khandekar)

  • Allow INSERT, UPDATE, and COPY on partitioned tables to properly route rows to foreign partitions (Etsuro Fujita, Amit Langote)

    This is supported by postgres_fdw foreign tables.

  • Allow faster partition elimination during query processing (Amit Langote, David Rowley, Dilip Kumar)

    This speeds access to partitioned tables with many partitions.

  • Allow partition elimination during query execution (David Rowley, Beena Emerson)

    Previously, partition elimination only happened at planning time, meaning many joins and prepared queries could not use partition elimination.

  • In an equality join between partitioned tables, allow matching partitions to be joined directly (Ashutosh Bapat)

    This feature is disabled by default but can be enabled by changing enable_partitionwise_join.

  • Allow aggregate functions on partitioned tables to be evaluated separately for each partition, subsequently merging the results (Jeevan Chalke, Ashutosh Bapat, Robert Haas)

    This feature is disabled by default but can be enabled by changing enable_partitionwise_aggregate.

  • Allow postgres_fdw to push down aggregates to foreign tables that are partitions (Jeevan Chalke)

E.2.3.1.2. Parallel Queries
  • Allow parallel building of a btree index (Peter Geoghegan, Rushabh Lathia, Heikki Linnakangas)

  • Allow hash joins to be performed in parallel using a shared hash table (Thomas Munro)

  • Allow UNION to run each SELECT in parallel if the individual SELECTs cannot be parallelized (Amit Khandekar, Robert Haas, Amul Sul)

  • Allow partition scans to more efficiently use parallel workers (Amit Khandekar, Robert Haas, Amul Sul)

  • Allow LIMIT to be passed to parallel workers (Robert Haas, Tom Lane)

    This allows workers to reduce returned results and use targeted index scans.

  • Allow single-evaluation queries, e.g. WHERE clause aggregate queries, and functions in the target list to be parallelized (Amit Kapila, Robert Haas)

  • Add server parameter parallel_leader_participation to control whether the leader also executes subplans (Thomas Munro)

    The default is enabled, meaning the leader will execute subplans.

  • Allow parallelization of commands CREATE TABLE ... AS, SELECT INTO, and CREATE MATERIALIZED VIEW (Haribabu Kommi)

  • Improve performance of sequential scans with many parallel workers (David Rowley)

  • Add reporting of parallel workers' sort activity in EXPLAIN (Robert Haas, Tom Lane)

E.2.3.1.3. Indexes
  • Allow B-tree indexes to include columns that are not part of the search key or unique constraint, but are available to be read by index-only scans (Anastasia Lubennikova, Alexander Korotkov, Teodor Sigaev)

    This is enabled by the new INCLUDE clause of CREATE INDEX. It facilitates building covering indexes that optimize specific types of queries. Columns can be included even if their data types don't have B-tree support.

  • Improve performance of monotonically increasing index additions (Pavan Deolasee, Peter Geoghegan)

  • Improve performance of hash index scans (Ashutosh Sharma)

  • Add predicate locking for hash, GiST and GIN indexes (Shubham Barai)

    This reduces the likelihood of serialization conflicts in serializable-mode transactions.

  • Allow heap-only-tuple (HOT) updates for expression indexes when the values of the expressions are unchanged (Konstantin Knizhnik)

E.2.3.1.3.1. SP-Gist
  • Add prefix-match operator text ^@ text, which is supported by SP-GiST (Ildus Kurbangaliev)

    This is similar to using var LIKE 'word%' with a btree index, but it is more efficient.

  • Allow polygons to be indexed with SP-GiST (Nikita Glukhov, Alexander Korotkov)

  • Allow SP-GiST to use lossy representation of leaf keys (Teodor Sigaev, Heikki Linnakangas, Alexander Korotkov, Nikita Glukhov)

E.2.3.1.4. Optimizer
  • Improve selection of the most common values for statistics (Jeff Janes, Dean Rasheed)

    Previously, the most common values (MCVs) were identified based on their frequency compared to all column values. Now, MCVs are chosen based on their frequency compared to the non-MCV values. This improves the robustness of the algorithm for both uniform and non-uniform distributions.

  • Improve selectivity estimates for >= and <= (Tom Lane)

    Previously, such cases used the same selectivity estimates as > and <, respectively, unless the comparison constants are MCVs. This change is particularly helpful for queries involving BETWEEN with small ranges.

  • Reduce var = var to var IS NOT NULL where equivalent (Tom Lane)

    This leads to better selectivity estimates.

  • Improve optimizer's row count estimates for EXISTS and NOT EXISTS queries (Tom Lane)

  • Make the optimizer account for evaluation costs and selectivity of HAVING clauses (Tom Lane)

E.2.3.1.5. General Performance
  • Add Just-in-Time (JIT) compilation of some parts of query plans to improve execution speed (Andres Freund)

    This feature requires LLVM to be available. It is not currently enabled by default, even in builds that support it.

  • Allow bitmap scans to perform index-only scans when possible (Alexander Kuzmenkov)

  • Update the free space map during VACUUM (Claudio Freire)

    This allows free space to be reused more quickly.

  • Allow VACUUM to avoid unnecessary index scans (Masahiko Sawada, Alexander Korotkov)

  • Improve performance of committing multiple concurrent transactions (Amit Kapila)

  • Reduce memory usage for queries using set-returning functions in their target lists (Andres Freund)

  • Improve the speed of aggregate computations (Andres Freund)

  • Allow postgres_fdw to push UPDATEs and DELETEs using joins to foreign servers (Etsuro Fujita)

    Previously, only non-join UPDATEs and DELETEs were pushed.

  • Add support for large pages on Windows (Takayuki Tsunakawa, Thomas Munro)

    This is controlled by the huge_pages configuration parameter.

E.2.3.1.6. Monitoring
  • Show memory usage in output from log_statement_stats, log_parser_stats, log_planner_stats, and log_executor_stats (Justin Pryzby, Peter Eisentraut)

  • Add column pg_stat_activity.backend_type to show the type of a background worker (Peter Eisentraut)

    The type is also visible in ps output.

  • Make log_autovacuum_min_duration log skipped tables that are concurrently being dropped (Nathan Bossart)

E.2.3.1.6.1. Information Schema
  • Add information_schema columns related to table constraints and triggers (Peter Eisentraut)

    Specifically, triggers.action_order, triggers.action_reference_old_table, and triggers.action_reference_new_table are now populated, where before they were always null. Also, table_constraints.enforced now exists but is not yet usefully populated.

E.2.3.1.7. Authentication
  • Allow the server to specify more complex LDAP specifications in search+bind mode (Thomas Munro)

    Specifically, ldapsearchfilter allows pattern matching using combinations of LDAP attributes.

  • Allow LDAP authentication to use encrypted LDAP (Thomas Munro)

    We already supported LDAP over TLS by using ldaptls=1. This new TLS LDAP method for encrypted LDAP is enabled with ldapscheme=ldaps or ldapurl=ldaps://.

  • Improve logging of LDAP errors (Thomas Munro)

E.2.3.1.8. Permissions
  • Add default roles that enable file system access (Stephen Frost)

    Specifically, the new roles are: pg_read_server_files, pg_write_server_files, and pg_execute_server_program. These roles now also control who can use server-side COPY and the file_fdw extension. Previously, only superusers could use these functions, and that is still the default behavior.

  • Allow access to file system functions to be controlled by GRANT/REVOKE permissions, rather than superuser checks (Stephen Frost)

    Specifically, these functions were modified: pg_ls_dir(), pg_read_file(), pg_read_binary_file(), pg_stat_file().

  • Use GRANT/REVOKE to control access to lo_import() and lo_export() (Michael Paquier, Tom Lane)

    Previously, only superusers were granted access to these functions.

    The compile-time option ALLOW_DANGEROUS_LO_FUNCTIONS has been removed.

  • Use view owner not session owner when preventing non-password access to postgres_fdw tables (Robert Haas)

    PostgreSQL only allows superusers to access postgres_fdw tables without passwords, e.g. via peer. Previously, the session owner had to be a superuser to allow such access; now the view owner is checked instead.

  • Fix invalid locking permission check in SELECT FOR UPDATE on views (Tom Lane)

E.2.3.1.9. Server Configuration
  • Add server setting ssl_passphrase_command to allow supplying of the passphrase for SSL key files (Peter Eisentraut)

    Also add ssl_passphrase_command_supports_reload to specify whether the SSL configuration should be reloaded and ssl_passphrase_command called during a server configuration reload.

  • Add storage parameter toast_tuple_target to control the minimum tuple length before TOAST storage will be considered (Simon Riggs)

    The default TOAST threshold has not been changed.

  • Allow server options related to memory and file sizes to be specified in units of bytes (Beena Emerson)

    The new unit suffix is B. This is in addition to the existing units kB, MB, GB and TB.

E.2.3.1.10. Write-Ahead Log (WAL)
  • Allow the WAL file size to be set during initdb (Beena Emerson)

    Previously, the 16MB default could only be changed at compile time.

  • Retain WAL data for only a single checkpoint (Simon Riggs)

    Previously, WAL was retained for two checkpoints.

  • Fill the unused portion of force-switched WAL segment files with zeros for improved compressibility (Chapman Flack)

E.2.3.2. Base Backup and Streaming Replication

  • Replicate TRUNCATE activity when using logical replication (Simon Riggs, Marco Nenciarini, Peter Eisentraut)

  • Pass prepared transaction information to logical replication subscribers (Nikhil Sontakke, Stas Kelvich)

  • Exclude unlogged tables, temporary tables, and pg_internal.init files from streaming base backups (David Steele)

    There is no need to copy such files.

  • Allow checksums of heap pages to be verified during streaming base backup (Michael Banck)

  • Allow replication slots to be advanced programmatically, rather than be consumed by subscribers (Petr Jelinek)

    This allows efficient advancement of replication slots when the contents do not need to be consumed. This is performed by pg_replication_slot_advance().

  • Add timeline information to the backup_label file (Michael Paquier)

    Also add a check that the WAL timeline matches the backup_label file's timeline.

  • Add host and port connection information to the pg_stat_wal_receiver system view (Haribabu Kommi)

E.2.3.3. Utility Commands

  • Allow ALTER TABLE to add a column with a non-null default without doing a table rewrite (Andrew Dunstan, Serge Rielau)

    This is enabled when the default value is a constant.

  • Allow views to be locked by locking the underlying tables (Yugo Nagata)

  • Allow ALTER INDEX to set statistics-gathering targets for expression indexes (Alexander Korotkov, Adrien Nayrat)

    In psql, \d+ now shows the statistics target for indexes.

  • Allow multiple tables to be specified in one VACUUM or ANALYZE command (Nathan Bossart)

    Also, if any table mentioned in VACUUM uses a column list, then the ANALYZE keyword must be supplied; previously, ANALYZE was implied in such cases.

  • Add parenthesized options syntax to ANALYZE (Nathan Bossart)

    This is similar to the syntax supported by VACUUM.

  • Add CREATE AGGREGATE option to specify the behavior of the aggregate's finalization function (Tom Lane)

    This is helpful for allowing user-defined aggregate functions to be optimized and to work as window functions.

E.2.3.4. Data Types

  • Allow the creation of arrays of domains (Tom Lane)

    This also allows array_agg() to be used on domains.

  • Support domains over composite types (Tom Lane)

    Also allow PL/Perl, PL/Python, and PL/Tcl to handle composite-domain function arguments and results. Also improve PL/Python domain handling.

  • Add casts from JSONB scalars to numeric and boolean data types (Anastasia Lubennikova)

E.2.3.5. Functions

  • Add all window function framing options specified by SQL:2011 (Oliver Ford, Tom Lane)

    Specifically, allow RANGE mode to use PRECEDING and FOLLOWING to select rows having grouping values within plus or minus the specified offset. Add GROUPS mode to include plus or minus the number of peer groups. Frame exclusion syntax was also added.

  • Add SHA-2 family of hash functions (Peter Eisentraut)

    Specifically, sha224(), sha256(), sha384(), sha512() were added.

  • Add support for 64-bit non-cryptographic hash functions (Robert Haas, Amul Sul)

  • Allow to_char() and to_timestamp() to specify the time zone's offset from UTC in hours and minutes (Nikita Glukhov, Andrew Dunstan)

    This is done with format specifications TZH and TZM.

  • Add text search function websearch_to_tsquery() that supports a query syntax similar to that used by web search engines (Victor Drobny, Dmitry Ivanov)

  • Add functions json(b)_to_tsvector() to create a text search query for matching JSON/JSONB values (Dmitry Dolgov)

E.2.3.6. Server-Side Languages

  • Add SQL-level procedures, which can start and commit their own transactions (Peter Eisentraut)

    They are created with the new CREATE PROCEDURE command and invoked via CALL.

    The new ALTER/DROP ROUTINE commands allow altering/dropping of all routine-like objects, including procedures, functions, and aggregates.

    Also, writing FUNCTION is now preferred over writing PROCEDURE in CREATE OPERATOR and CREATE TRIGGER, because the referenced object must be a function not a procedure. However, the old syntax is still accepted for compatibility.

  • Add transaction control to PL/pgSQL, PL/Perl, PL/Python, PL/Tcl, and SPI server-side languages (Peter Eisentraut)

    Transaction control is only available within top-transaction-level procedures and nested DO and CALL blocks that only contain other DO and CALL blocks.

  • Add the ability to define PL/pgSQL composite-type variables as not null, constant, or with initial values (Tom Lane)

  • Allow PL/pgSQL to handle changes to composite types (e.g. record, row) that happen between the first and later function executions in the same session (Tom Lane)

    Previously, such circumstances generated errors.

  • Add extension jsonb_plpython to transform JSONB to/from PL/Python types (Anthony Bykov)

  • Add extension jsonb_plperl to transform JSONB to/from PL/Perl types (Anthony Bykov)

E.2.3.7. Client Interfaces

  • Change libpq to disable compression by default (Peter Eisentraut)

    Compression is already disabled in modern OpenSSL versions, so that the libpq setting had no effect with such libraries.

  • Add DO CONTINUE option to ecpg's WHENEVER statement (Vinayak Pokale)

    This generates a C continue statement, causing a return to the top of the contained loop when the specified condition occurs.

  • Add an ecpg mode to enable Oracle Pro*C-style handling of char arrays.

    This mode is enabled with -C.

E.2.3.8. Client Applications

E.2.3.8.1. psql
  • Add psql command \gdesc to display the names and types of the columns in a query result (Pavel Stehule)

  • Add psql variables to report query activity and errors (Fabien Coelho)

    Specifically, the new variables are ERROR, SQLSTATE, ROW_COUNT, LAST_ERROR_MESSAGE, and LAST_ERROR_SQLSTATE.

  • Allow psql to test for the existence of a variable (Fabien Coelho)

    Specifically, the syntax :{?variable_name} allows a variable's existence to be tested in an \if statement.

  • Allow environment variable PSQL_PAGER to control psql's pager (Pavel Stehule)

    This allows psql's default pager to be specified as a separate environment variable from the pager for other applications. PAGER is still honored if PSQL_PAGER is not set.

  • Make psql's \d+ command always show the table's partitioning information (Amit Langote, Ashutosh Bapat)

    Previously, partition information would not be displayed for a partitioned table if it had no partitions. Also indicate which partitions are themselves partitioned.

  • Ensure that psql reports the proper user name when prompting for a password (Tom Lane)

    Previously, combinations of -U and a user name embedded in a URI caused incorrect reporting. Also suppress the user name before the password prompt when --password is specified.

  • Allow quit and exit to exit psql when given with no prior input (Bruce Momjian)

    Also print hints about how to exit when quit and exit are used alone on a line while the input buffer is not empty. Add a similar hint for help.

  • Make psql hint at using control-D when \q is entered alone on a line but ignored (Bruce Momjian)

    For example, \q does not exit when supplied in character strings.

  • Improve tab completion for ALTER INDEX RESET/SET (Masahiko Sawada)

  • Add infrastructure to allow psql to adapt its tab completion queries based on the server version (Tom Lane)

    Previously, tab completion queries could fail against older servers.

E.2.3.8.2. pgbench
  • Add pgbench expression support for NULLs, booleans, and some functions and operators (Fabien Coelho)

  • Add \if conditional support to pgbench (Fabien Coelho)

  • Allow the use of non-ASCII characters in pgbench variable names (Fabien Coelho)

  • Add pgbench option --init-steps to control the initialization steps performed (Masahiko Sawada)

  • Add an approximately Zipfian-distributed random generator to pgbench (Alik Khilazhev)

  • Allow the random seed to be set in pgbench (Fabien Coelho)

  • Allow pgbench to do exponentiation with pow() and power() (Raúl Marín Rodríguez)

  • Add hashing functions to pgbench (Ildar Musin)

  • Make pgbench statistics more accurate when using --latency-limit and --rate (Fabien Coelho)

E.2.3.9. Server Applications

  • Add an option to pg_basebackup that creates a named replication slot (Michael Banck)

    The option --create-slot creates the named replication slot (--slot) when the WAL streaming method (--wal-method=stream) is used.

  • Allow initdb to set group read access to the data directory (David Steele)

    This is accomplished with the new initdb option --allow-group-access. Administrators can also set group permissions on the empty data directory before running initdb. Server variable data_directory_mode allows reading of data directory group permissions.

  • Add pg_verify_checksums tool to verify database checksums while offline (Magnus Hagander)

  • Allow pg_resetwal to change the WAL segment size via --wal-segsize (Nathan Bossart)

  • Add long options to pg_resetwal and pg_controldata (Nathan Bossart, Peter Eisentraut)

  • Add pg_receivewal option --no-sync to prevent synchronous WAL writes, for testing (Michael Paquier)

  • Add pg_receivewal option --endpos to specify when WAL receiving should stop (Michael Paquier)

  • Allow pg_ctl to send the SIGKILL signal to processes (Andres Freund)

    This was previously unsupported due to concerns over possible misuse.

  • Reduce the number of files copied by pg_rewind (Michael Paquier)

  • Prevent pg_rewind from running as root (Michael Paquier)

  • Add pg_dumpall option --encoding to control output encoding (Michael Paquier)

    pg_dump already had this option.

  • Add pg_dump option --load-via-partition-root to force loading of data into the partition's root table, rather than the original partition (Rushabh Lathia)

    This is useful if the system to be loaded to has different collation definitions or endianness, possibly requiring rows to be stored in different partitions than previously.

  • Add an option to suppress dumping and restoring database object comments (Robins Tharakan)

    The new pg_dump, pg_dumpall, and pg_restore option is --no-comments.

E.2.3.10. Source Code

  • Add PGXS support for installing include files (Andrew Gierth)

    This supports creating extension modules that depend on other modules. Formerly there was no easy way for the dependent module to find the referenced one's include files. Several existing contrib modules that define data types have been adjusted to install relevant files. Also, PL/Perl and PL/Python now install their include files, to support creation of transform modules for those languages.

  • Install errcodes.txt to allow extensions to access the list of error codes known to PostgreSQL (Thomas Munro)

  • Convert documentation to DocBook XML (Peter Eisentraut, Alexander Lakhin, Jürgen Purtz)

    The file names still use an sgml extension for compatibility with back branches.

  • Use stdbool.h to define type bool on platforms where it's suitable, which is most (Peter Eisentraut)

    This eliminates a coding hazard for extension modules that need to include stdbool.h.

  • Overhaul the way that initial system catalog contents are defined (John Naylor)

    The initial data is now represented in Perl data structures, making it much easier to manipulate mechanically.

  • Prevent extensions from creating custom server parameters that take a quoted list of values (Tom Lane)

    This cannot be supported at present because knowledge of the parameter's property would be required even before the extension is loaded.

  • Add ability to use channel binding when using SCRAM authentication (Michael Paquier)

    Channel binding is intended to prevent man-in-the-middle attacks, but SCRAM cannot prevent them unless it can be forced to be active. Unfortunately, there is no way to do that in libpq. Support for it is expected in future versions of libpq and in interfaces not built using libpq, e.g. JDBC.

  • Allow background workers to attach to databases that normally disallow connections (Magnus Hagander)

  • Add support for hardware CRC calculations on ARMv8 (Yuqi Gu, Heikki Linnakangas, Thomas Munro)

  • Speed up lookups of built-in functions by OID (Andres Freund)

    The previous binary search has been replaced by a lookup array.

  • Speed up construction of query results (Andres Freund)

  • Improve speed of access to system caches (Andres Freund)

  • Add a generational memory allocator which is optimized for serial allocation/deallocation (Tomas Vondra)

    This reduces memory usage for logical decoding.

  • Make the computation of pg_class.reltuples by VACUUM consistent with its computation by ANALYZE (Tomas Vondra)

  • Update to use perltidy version 20170521 (Tom Lane, Peter Eisentraut)

E.2.3.11. Additional Modules

  • Allow extension pg_prewarm to restore the previous shared buffer contents on startup (Mithun Cy, Robert Haas)

    This is accomplished by having pg_prewarm store the shared buffers' relation and block number data to disk occasionally during server operation, and at shutdown.

  • Add pg_trgm function strict_word_similarity() to compute the similarity of whole words (Alexander Korotkov)

    The function word_similarity() already existed for this purpose, but it was designed to find similar parts of words, while strict_word_similarity() computes the similarity to whole words.

  • Allow creation of indexes that can be used by LIKE comparisons on citext columns (Alexey Chernyshov)

    To do this, the index must be created using the citext_pattern_ops operator class.

  • Allow btree_gin to index bool, bpchar, name and uuid data types (Matheus Oliveira)

  • Allow cube and seg extensions to perform index-only scans using GiST indexes (Andrey Borodin)

  • Allow retrieval of negative cube coordinates using the ~> operator (Alexander Korotkov)

    This is useful for KNN-GiST searches when looking for coordinates in descending order.

  • Add Vietnamese letter handling to the unaccent extension (Dang Minh Huong, Michael Paquier)

  • Enhance amcheck to check that each heap tuple has an index entry (Peter Geoghegan)

  • Have adminpack use the new default file system access roles (Stephen Frost)

    Previously, only superusers could call adminpack functions; now role permissions are checked.

  • Widen pg_stat_statement's query ID to 64 bits (Robert Haas)

    This greatly reduces the chance of query ID hash collisions. The query ID can now potentially display as a negative value.

  • Remove the contrib/start-scripts/osx scripts since they are no longer recommended (use contrib/start-scripts/macos instead) (Tom Lane)

  • Remove the chkpass extension (Peter Eisentraut)

    This extension is no longer considered to be a usable security tool or example of how to write an extension.

E.2.4. Acknowledgments

The following individuals (in alphabetical order) have contributed to this release as patch authors, committers, reviewers, testers, or reporters of issues.

Abhijit Menon-Sen
Adam Bielanski
Adam Brightwell
Adam Brusselback
Aditya Toshniwal
Adrián Escoms
Adrien Nayrat
Akos Vandra
Aleksander Alekseev
Aleksandr Parfenov
Alexander Korotkov
Alexander Kukushkin
Alexander Kuzmenkov
Alexander Lakhin
Alexandre Garcia
Alexey Bashtanov
Alexey Chernyshov
Alexey Kryuchkov
Alik Khilazhev
Álvaro Herrera
Amit Kapila
Amit Khandekar
Amit Langote
Amul Sul
Anastasia Lubennikova
Andreas Joseph Krogh
Andreas Karlsson
Andreas Seltenreich
André Hänsel
Andrei Gorita
Andres Freund
Andrew Dunstan
Andrew Fletcher
Andrew Gierth
Andrew Grossman
Andrew Krasichkov
Andrey Borodin
Andrey Lizenko
Andy Abelisto
Anthony Bykov
Antoine Scemama
Anton Dignös
Antonin Houska
Arseniy Sharoglazov
Arseny Sher
Arthur Zakirov
Ashutosh Bapat
Ashutosh Sharma
Ashwin Agrawal
Asim Praveen
Atsushi Torikoshi
Badrul Chowdhury
Balazs Szilfai
Basil Bourque
Beena Emerson
Ben Chobot
Benjamin Coutu
Bernd Helmle
Blaz Merela
Brad DeJong
Brent Dearth
Brian Cloutier
Bruce Momjian
Catalin Iacob
Chad Trabant
Chapman Flack
Christian Duta
Christian Ullrich
Christoph Berg
Christoph Dreis
Christophe Courtois
Christopher Jones
Claudio Freire
Clayton Salem
Craig Ringer
Dagfinn Ilmari Mannsåker
Dan Vianello
Dan Watson
Dang Minh Huong
Daniel Gustafsson
Daniel Vérité
Daniel Westermann
Daniel Wood
Darafei Praliaskouski
Dave Cramer
Dave Page
David Binderman
David Carlier
David Fetter
David G. Johnston
David Gould
David Hinkle
David Pereiro Lagares
David Rader
David Rowley
David Steele
Davy Machado
Dean Rasheed
Dian Fay
Dilip Kumar
Dmitriy Sarafannikov
Dmitry Dolgov
Dmitry Ivanov
Dmitry Shalashov
Don Seiler
Doug Doole
Doug Rady
Edmund Horner
Eiji Seki
Elvis Pranskevichus
Emre Hasegeli
Erik Rijkers
Erwin Brandstetter
Etsuro Fujita
Euler Taveira
Everaldo Canuto
Fabien Coelho
Fabrízio de Royes Mello
Feike Steenbergen
Frits Jalvingh
Fujii Masao
Gao Zengqi
Gianni Ciolli
Greg Stark
Gunnlaugur Thor Briem
Guo Xiang Tan
Hadi Moshayedi
Hailong Li
Haribabu Kommi
Heath Lord
Heikki Linnakangas
Hugo Mercier
Igor Korot
Igor Neyman
Ildar Musin
Ildus Kurbangaliev
Ioseph Kim
Jacob Champion
Jaime Casanova
Jakob Egger
Jean-Pierre Pelletier
Jeevan Chalke
Jeevan Ladhe
Jeff Davis
Jeff Janes
Jeremy Evans
Jeremy Finzel
Jeremy Schneider
Jesper Pedersen
Jim Nasby
Jimmy Yih
Jing Wang
Jobin Augustine
Joe Conway
John Gorman
John Naylor
Jon Nelson
Jon Wolski
Jonathan Allen
Jonathan S. Katz
Julien Rouhaud
Jürgen Purtz
Justin Pryzby
KaiGai Kohei
Kaiting Chen
Karl Lehenbauer
Keith Fiske
Kevin Bloch
Kha Nguyen
Kim Rose Carlsen
Konstantin Knizhnik
Kuntal Ghosh
Kyle Samson
Kyotaro Horiguchi
Lætitia Avrot
Lars Kanis
Laurenz Albe
Leonardo Cecchi
Liudmila Mantrova
Lixian Zou
Lloyd Albin
Luca Ferrari
Lucas Fairchild
Lukas Eder
Lukas Fittl
Magnus Hagander
Mai Peng
Maksim Milyutin
Maksym Boguk
Mansur Galiev
Marc Dilger
Marco Nenciarini
Marina Polyakova
Mario de Frutos Dieguez
Mark Cave-Ayland
Mark Dilger
Mark Wood
Marko Tiikkaja
Markus Winand
Martín Marqués
Masahiko Sawada
Matheus Oliveira
Matthew Stickney
Metin Doslu
Michael Banck
Michael Meskes
Michael Paquier
Michail Nikolaev
Mike Blackwell
Minh-Quan Tran
Mithun Cy
Morgan Owens
Nathan Bossart
Nathan Wagner
Neil Conway
Nick Barnes
Nicolas Thauvin
Nikhil Sontakke
Nikita Glukhov
Nikolay Shaplov
Noah Misch
Noriyoshi Shinoda
Oleg Bartunov
Oleg Samoilov
Oliver Ford
Pan Bian
Pascal Legrand
Patrick Hemmer
Patrick Krecker
Paul Bonaud
Paul Guo
Paul Ramsey
Pavan Deolasee
Pavan Maddamsetti
Pavel Golub
Pavel Stehule
Peter Eisentraut
Peter Geoghegan
Petr Jelínek
Petru-Florin Mihancea
Phil Florent
Philippe Beaudoin
Pierre Ducroquet
Piotr Stefaniak
Prabhat Sahu
Pu Qun
QL Zhuo
Rafia Sabih
Rahila Syed
Rainer Orth
Rajkumar Raghuwanshi
Raúl Marín Rodríguez
Regina Obe
Richard Yen
Robert Haas
Robins Tharakan
Rod Taylor
Rushabh Lathia
Ryan Murphy
Sahap Asci
Samuel Horwitz
Scott Ure
Sean Johnston
Shao Bret
Shay Rojansky
Shubham Barai
Simon Riggs
Simone Gotti
Sivasubramanian Ramasubramanian
Stas Kelvich
Stefan Kaltenbrunner
Stephen Froehlich
Stephen Frost
Steve Singer
Steven Winfield
Sven Kunze
Taiki Kondo
Takayuki Tsunakawa
Takeshi Ideriha
Tatsuo Ishii
Tatsuro Yamada
Teodor Sigaev
Thom Brown
Thomas Kellerer
Thomas Munro
Thomas Reiss
Tobias Bussmann
Todd A. Cook
Tom Kazimiers
Tom Lane
Tomas Vondra
Tomonari Katsumata
Torsten Grust
Tushar Ahuja
Vaishnavi Prabakaran
Vasundhar Boddapati
Victor Drobny
Victor Wagner
Victor Yegorov
Vik Fearing
Vinayak Pokale
Vincent Lachenal
Vitaliy Garnashevich
Vitaly Burovoy
Vladimir Baranoff
Xin Zhang
Yi Wen Wong
Yorick Peterse
Yugo Nagata
Yuqi Gu
Yura Sokolov
Yves Goergen
Zhou Digoal