what's new in postgresql 9.3

16
© 2013 EnterpriseDB, Corp. All Rights Reserved. 1 What’s New in PostgreSQL 9.3 Bruce Momjian 9.25.13 Techie Topic Series

Upload: enterprisedb

Post on 14-Jan-2015

3.959 views

Category:

Technology


0 download

DESCRIPTION

This presentation goes over the PGSQL 9.3 key features along with several other exciting additions released in early September 2013. These features will also be available in the 9.3 release of Postgres Plus Advanced Server. Include_dir configuration directive Copy freeze Custom background workers Additional JSON functionality Lateral join Parallel pg_dump pg_isready Posix shared memory/mmap Event triggers Materialized views Recursive views Updateable views Writeable foreign tables / postgres_fdw Streaming only remastering Fast failover Architecture-independent streaming pg_basebackup recovery.conf autosetup

TRANSCRIPT

Page 1: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 1

What’s New in PostgreSQL 9.3 Bruce Momjian 9.25.13

Techie Topic Series

Page 2: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 2

!!!Providing enterprises with the cost-performance benefits of Postgres by offering the products, resources, support and dependability required for high-level commercial applications.!• 140+ employees

• 2,500+ customers across all market segments

• Global presence with offices in North America, Europe, Asia

• Fast growing: 60%+ YOY sales growth in 2012, 80%+ YOY 2013

• Strong financial banking:

© 2013 EnterpriseDB. All rights reserved.

Page 3: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 3

•  Add materialized views

•  Make simple views auto-updatable

•  Add many features for the JSON data type, including operators and functions to extract elements from JSON values

•  Implement SQL-standard LATERAL option for FROM-clause subqueries and function calls

•  Allow foreign data wrappers to support writes (inserts/updates/deletes) on foreign tables

•  Add a Postgres foreign data wrapper to allow access to other Postgres servers

•  Add support for event triggers

•  Add optional ability to checksum data pages and report corruption

•  Prevent non-key-field row updates from blocking foreign key checks

•  Greatly reduce System V shared memory requirements

Reference: http://www.postgresql.org/docs/9.3/static/release-9-3.html

Major Enhancements in PostgreSQL 9.3

Page 4: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 4

Unlike ordinary views, where the base tables are read on every access, materialized views create physical tables at creation or refresh time. Access to the materialized view then reads from its physical table. There is not yet any facility for incrementally refreshing materialized views or auto-accessing them via base table access.

Reference: E.1.3.4.2. VIEWs in PostgreSQL 9.3 release notes

Add Materialized Views

Page 5: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 5

Simple views that reference some or all columns from a single base table are now updatable by default. More complex views can be made updatable using INSTEAD OF triggers or INSTEAD rules.

Make Simple Views Auto-Updatable

Page 6: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 6

•  Add many features for the JSON data type, including operators and functions to extract elements from JSON values

Operators and Functions

Page 7: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 7

•  Implement SQL-standard LATERAL option for FROM-clause subqueries and function calls

This feature allows subqueries and functions in FROM to reference columns from other tables in the FROM clause. The LATERAL keyword is optional for functions.

•  Add support for piping COPY and psql \copy data to/from an external program

•  Allow a multirow VALUES clause in a rule to reference OLD/NEW (Tom Lane)

Reference: http://www.postgresql.org/docs/9.3/static/queries-table-expressions.html#QUERIES-LATERAL

Implement SQL-standard LATERAL option for FROM-clause subqueries and function calls

Page 8: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 8

CREATE FOREIGN DATA WRAPPER -- define a new foreign-data wrapper

Synopsis CREATE FOREIGN DATA WRAPPER name [ HANDLER handler_function | NO HANDLER ] [ VALIDATOR validator_function | NO VALIDATOR ] [ OPTIONS ( option 'value' [, ... ] ) ]

Description CREATE FOREIGN DATA WRAPPER creates a new foreign-data wrapper. The user who defines a foreign-data wrapper becomes its owner.

The foreign-data wrapper name must be unique within the database.

Only superusers can create foreign-data wrappers.

Reference: http://www.postgresql.org/docs/9.3/static/sql-createforeigndatawrapper.html

Allow foreign data wrappers to support writes (inserts/updates/deletes) on foreign tables

Page 9: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 9

•  Add a Postgres foreign data wrapper contrib module to allow access to other Postgres servers. This foreign data wrapper supports writes.

Postgres Foreign Data Wrapper

Page 10: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 10

Add support for event triggers

This allows server-side functions written in event-enabled languages to be called when DDL commands are run.

Event Triggers

Page 11: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 11

Add optional ability to checksum data pages and report corruption. The checksum option can be set during initdb

Checksum

Page 12: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 12

•  This change improves concurrency and reduces the probability of deadlocks when updating tables involved in a foreign-key constraint. UPDATEs that do not change any columns referenced in a foreign key now take the new NO KEY UPDATE lock mode on the row, while foreign key checks use the new KEY SHARE lock mode, which does not conflict with NO KEY UPDATE. So there is no blocking unless a foreign-key column is changed.

•  Add configuration variable lock_timeout to allow limiting how long a

session will wait to acquire any one lock.

Prevent non-key-field row updates from blocking foreign key checks

Page 13: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 13

•  Shared memory and semaphores are collectively referred to as "System V IPC" (together with message queues, which are not relevant for PostgreSQL). Except on Windows, where PostgreSQL provides its own replacement implementation of these facilities, these facilities are required in order to run PostgreSQL.

•  The complete lack of these facilities is usually manifested by an Illegal system call error upon server start. In that case there is no alternative but to reconfigure your kernel. PostgreSQL won't work without them. This situation is rare, however, among modern operating systems.

•  When PostgreSQL exceeds one of the various hard IPC limits, the server will refuse to start and should leave an instructive error message describing the problem and what to do about it. (See also Section 17.3.1.) The relevant kernel parameters are named consistently across different systems; Table 17-1 gives an overview. The methods to set them, however, vary.

Note: Prior to PostgreSQL 9.3, the amount of System V shared memory required to start the server was much larger. If you are running an older version of the server, please consult the documentation for your server version.

Shared Memory

Page 14: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 14

•  9.3 Documentation http://www.postgresql.org/docs/9.3/static/release-9-3.html

•  9.3 Wikihttps://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#JSON:_Additional_functionality

If you have questions about the future release of Postgres Plus Advanced Server 9.3, or EnterpriseDB’s support for PostgreSQL 9.3 please email

[email protected] and someone will follow up with you within 24 hours.

This presentation and the slides will be shared with all of today’s registrants.

For more information on PostgreSQL 9.3

Page 15: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 15

Bruce Momjian Co-Founder of the PostgreSQL Global Development Group [email protected] http://momjian.us/

Let us know if we can help…

© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.

Page 16: What's New in PostgreSQL 9.3

© 2013 EnterpriseDB, Corp. All Rights Reserved. 16