Todo

From PostgreSQL wiki

Jump to: navigation, search

Contents

This list contains some known PostgreSQL bugs, some feature requests, and some things we are not even sure we want. Many of these items are hard, and some are perhaps impossible. If you would like to work on an item, please read the Developer FAQ first. There is also a development information page.

  • Incomplete item  - marks ordinary, incomplete items
  • [E] Incomplete item  - marks items that are easier to implement
  • [D] Completed item - marks changes that are done, and will appear in the PostgreSQL 11 release.

For help on editing this list, please see Talk:Todo. Please do not add items here without discussion on the mailing list.

Development Process

WARNING for Developers: Unfortunately this list does not contain all the information necessary for someone to start coding a feature. Some of these items might have become unnecessary since they were added --- others might be desirable but the implementation might be unclear. When selecting items listed below, be prepared to first discuss the value of the feature. Do not assume that you can select one, code it and then expect it to be committed. Always discuss design on Hackers list before starting to code. The flow should be:

    Desirability -> Design -> Implement -> Test -> Review -> Commit

Administration

Incomplete item Allow administrators to cancel long-lived prepared transactions

Incomplete item Check for unreferenced table files created by transactions that were in-progress when the server terminated abruptly

Incomplete item Allow log_min_messages to be specified on a per-module basis

This would allow administrators to see more detailed information from specific sections of the backend, e.g. checkpoints, autovacuum, etc. Another idea is to allow separate configuration files for each module, or allow arbitrary SET commands to be passed to them. See also Logging Brainstorm.

Incomplete item Allow custom variables to appear in pg_settings()

Incomplete item Have custom variables be transaction-safe

Incomplete item Implement the SQL-standard mechanism whereby REVOKE ROLE revokes only the privilege granted by the invoking role, and not those granted by other roles

Incomplete item Prevent query cancel packets from being replayed by an attacker, especially when using SSL

Incomplete item Improve logging of prepared transactions recovered during startup

Incomplete item Consider supporting incremental base backups

Configuration files

Incomplete item Consider normalizing fractions in postgresql.conf, perhaps using '%'

Incomplete item Add external tool to auto-tune some postgresql.conf parameters

Incomplete item Allow pg_hba.conf to process include files

Incomplete item Create utility to compute accurate random_page_cost value

Incomplete item Allow synchronous_standby_names to be disabled after communication failure with all synchronous standby servers exceeds some timeout

This also requires successful execution of a synchronous notification command.

Incomplete item Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block

  • Currently it displays zero.

Incomplete item Adjust rounding behavior for numeric GUC values

Tablespaces

Incomplete item Allow a database in tablespace t1 with tables created in tablespace t2 to be used as a template for a new database created with default tablespace t2

Currently all objects in the default database tablespace must have default tablespace specifications. This is because new databases are created by copying directories. If you mix default tablespace tables and tablespace-specified tables in the same directory, creating a new database from such a mixed directory would create a new database with tables that had incorrect explicit tablespaces. To fix this would require modifying pg_class in the newly copied database, which we don't currently do.

Incomplete item Allow reporting of which objects are in which tablespaces

This item is difficult because a tablespace can contain objects from multiple databases. There is a server-side function that returns the databases which use a specific tablespace, so this requires a tool that will call that function and connect to each database to find the objects in each database for that tablespace.

Incomplete item Allow WAL replay of CREATE TABLESPACE to work when the directory structure on the recovery computer is different from the original

Incomplete item Allow per-tablespace quotas

Incomplete item Allow tablespaces on RAM-based partitions for unlogged tables

Incomplete item Allow tablespaces on RAM-based partitions for temporary objects

Incomplete item Allow toast tables to be moved to a different tablespace

Incomplete item Close race in DROP TABLESPACE on Windows

Statistics Collector

Incomplete item Testing pgstat via pg_regress is tricky and inefficient. Consider making a dedicated pgstat test-suite.

Incomplete item Track number of WAL files ready to be archived in pg_stat_archiver

SSL

Incomplete item  Allow automatic selection of SSL client certificates from a certificate store

[D] Completed item Send the full certificate server chain to the client

Point-In-Time Recovery (PITR)

Incomplete item Allow archive_mode to be changed without server restart?

Standby server mode

Incomplete item  Allow pg_xlogfile_name() to be used in recovery mode

Incomplete item  Prevent variables inherited from the server environment from being used for making streaming replication connections

Incomplete item  Change walsender so that it applies per-role settings

Incomplete item  Restructure configuration parameters for standby mode

Data Types

Incomplete item Fix data types where equality comparison is not intuitive, e.g. box

Incomplete item Add support for public SYNONYMs

Incomplete item Add support for SQL-standard GENERATED columns

Incomplete item Consider a special data type for regular expressions

Incomplete item Allow deleting enumerated values from an existing enumerated data type

Incomplete item Add overlaps geometric operators that ignore point overlaps

Incomplete item  Add IMMUTABLE column attribute

Domains

Incomplete item Allow functions defined as casts to domains to be called during casting

Incomplete item Allow values to be cast to domain types

Incomplete item Make domains work better with polymorphic functions

Dates and Times

Incomplete item Allow infinite intervals just like infinite timestamps

Incomplete item Allow TIMESTAMP WITH TIME ZONE to store the original timezone information, either zone name or offset from UTC

If the TIMESTAMP value is stored with a time zone name, interval computations should adjust based on the time zone rules.

Incomplete item Have timestamp subtraction not call justify_hours()?

Incomplete item Allow a comma to denote fractional seconds in ISO-8601-compliant times (and timestamps)

Arrays

Incomplete item Allow single-byte header storage for array elements

Incomplete item Add function to detect if an array is empty

Incomplete item Improve handling of NULLs in arrays

MONEY Data Type

Incomplete item Add locale-aware MONEY type, and support multiple currencies

Incomplete item MONEY dumps in a locale-specific format making it difficult to restore to a system with a different locale

Text Search

Incomplete item Allow dictionaries to change the token that is passed on to later dictionaries

Incomplete item Consider a function-based API for '@@' searches

Incomplete item Improve text search error messages

Incomplete item Consider changing error to warning for strings larger than one megabyte

Incomplete item tsearch and tsdicts regression tests fail in Turkish locale on glibc

Incomplete item Improve handling of dash and plus signs in email address user names, and perhaps improve URL parsing

Incomplete item Improve default parser, to more easily allow adding new tokens

Incomplete item Add additional support functions

XML

Incomplete item Allow XML arrays to be cast to other data types

Incomplete item Add XML Schema validation and xmlvalidate functions (SQL:2008)

Incomplete item Add xmlvalidatedtd variant to support validating against a DTD?

Incomplete item Relax-NG validation; libxml2 supports this already

Incomplete item Allow reliable XML operation non-UTF8 server encodings (xpath(), in particular, is known to not work)

Incomplete item Add functions from SQL:2006: XMLDOCUMENT, XMLCAST, XMLTEXT

Incomplete item Add XMLNAMESPACES support in XMLELEMENT and elsewhere

Incomplete item Move XSLT from contrib/xml2 to a more reasonable location

Incomplete item Report errors returned by the XSLT library

Incomplete item Improve the XSLT parameter passing API

Incomplete item XML Canonical: Convert XML documents to canonical form to compare them. libxml2 has support for this.

Incomplete item Add pretty-printed XML output option

Parse a document and serialize it back in some indented form. libxml2 might support this.

Incomplete item Add XMLQUERY (from the SQL/XML standard)

Incomplete item Allow XML shredding

In some cases shredding could be better option (if there is no need to keep XML docs entirely, e.g. if we have already developed tools that understand only relational data. This would be a separate module that implements annotated schema decomposition technique, similar to DB2 and SQL Server functionality.

Incomplete item XPath: Adding the <x> at the root causes problems [1] [2] [3]

Incomplete item xpath_table needs to be implemented/implementable to get rid of contrib/xml2 [4]

Incomplete item xpath_table is pretty broken anyway [5]

Incomplete item better handling of XPath data types [6] [7]

Incomplete item Improve handling of PIs and DTDs in xmlconcat() [8]

Incomplete item Restructure XML and /contrib/xml2 functionality

Incomplete item Verify Xpath escaping behavior

Functions

Incomplete item Enforce typmod for function inputs, function results and parameters for spi_prepare'd statements called from PLs

Incomplete item Fix IS OF so it matches the ISO specification, and add documentation

Incomplete item Implement Boyer-Moore searching in LIKE queries

Incomplete item Prevent malicious functions from being executed with the permissions of unsuspecting users

Indexed functions are safe, so VACUUM and ANALYZE are safe too. Triggers, CHECK and DEFAULT expressions, and rules are still vulnerable.

Incomplete item Reduce memory usage of aggregates in set returning functions

Incomplete item Fix /contrib/ltree operator

Incomplete item Fix /contrib/btree_gist's implementation of inet indexing

Character Formatting

Incomplete item Allow to_date() and to_timestamp() to accept localized month names

Incomplete item Add missing parameter handling in to_char()

Incomplete item Throw an error from to_char() instead of printing a string of "#" when a number doesn't fit in the desired output format.

Incomplete item Fix to_number() handling for values not matching the format string

Multi-Language Support

Incomplete item Add NCHAR (as distinguished from ordinary varchar)

Incomplete item Add a cares-about-collation column to pg_proc, so that unresolved-collation errors can be thrown at parse time

Incomplete item Integrate collations with text search configurations

Incomplete item Integrate collations with to_char() and related functions

Incomplete item Support collation-sensitive equality and hashing functions

Incomplete item Add a LOCALE option to CREATE DATABASE, as a shorthand

Incomplete item Support multiple simultaneous character sets, per SQL:2008

Incomplete item Improve UTF8 combined character handling?

Incomplete item Add octet_length_server() and octet_length_client()

Incomplete item Make octet_length_client() the same as octet_length()?

Incomplete item Fix problems with wrong runtime encoding conversion for NLS message files

Incomplete item Fix contrib/fuzzystrmatch to work with multibyte encodings

Incomplete item Change memory allocation for multi-byte functions so memory is allocated inside conversion functions

Currently we preallocate memory based on worst-case usage.

Incomplete item Add ability to use case-insensitive regular expressions on multi-byte characters

Currently it works for UTF-8, but not other multi-byte encodings

Incomplete item Improve encoding of connection startup messages sent to the client

Currently some authentication error messages are sent in the server encoding

Incomplete item Windows: Cache MessageEncoding conversion for use outside transactions

Incomplete item More sensible support for Unicode combining characters, normal forms

Views and Rules

Incomplete item Allow VIEW/RULE recompilation when the underlying tables change

This is both difficult and controversial.

Incomplete item Make it possible to use RETURNING together with conditional DO INSTEAD rules, such as for partitioning setups

Incomplete item Improve ability to modify views via ALTER TABLE

SQL Commands

Incomplete item Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT

Incomplete item Improve type determination of unknown (NULL or quoted literal) result columns for UNION/INTERSECT/EXCEPT

Incomplete item Allow prepared transactions with temporary tables created and dropped in the same transaction, and when an ON COMMIT DELETE ROWS temporary table is accessed

Incomplete item Add a GUC variable to warn about non-standard SQL usage in queries

Incomplete item Add NOVICE output level for helpful messages

For example, have it warn about unjoined tables. This could also control automatic sequence/index creation messages.

[D] Completed itemAdd SQL-standard MERGE command

MERGE is typically used to merge two tables, for data warehousing type use cases. PostgreSQL has an "UPSERT" command as of version 9.5, with the addition of "ON CONFLICT DO UPDATE". SQL MERGE is independently useful, though.

Incomplete item Allow NOTIFY in rules involving conditionals

Incomplete item Allow LISTEN on patterns

Incomplete item Simplify dropping roles that have objects in several databases

Incomplete item Add support for WITH RECURSIVE ... CYCLE

Incomplete item Add DEFAULT .. AS OWNER so permission checks are done as the table owner

This would be useful for SERIAL nextval() calls and CHECK constraints.

Incomplete item Allow DISTINCT to work in multiple-argument aggregate calls

Incomplete item Add comments on system tables/columns using the information in catalogs.sgml

Ideally the information would be pulled from the SGML file automatically.

Incomplete item Prevent the specification of conflicting transaction read/write options

Incomplete item Allow DELETE and UPDATE to be used with LIMIT and ORDER BY

Incomplete item Allow PREPARE of cursors

Incomplete item Have DISCARD PLANS discard plans cached by functions

DISCARD ALL should do the same.

Incomplete item Avoid multiple-evaluation of BETWEEN and IN arguments containing volatile expressions

CREATE

Incomplete item Allow CREATE TABLE AS to determine column lengths for complex expressions like SELECT col1

Incomplete item Have WITH CONSTRAINTS also create constraint indexes

Incomplete item Move NOT NULL constraint information to pg_constraint

Currently NOT NULL constraints are stored in pg_attribute without any designation of their origins, e.g. primary keys. One manifest problem is that dropping a PRIMARY KEY constraint does not remove the NOT NULL constraint designation. Another issue is that we should probably force NOT NULL to be propagated from parent tables to children, just as CHECK constraints are. (But then does dropping PRIMARY KEY affect children?)

Incomplete item Prevent concurrent CREATE TABLE from sometimes returning a cryptic error message

Incomplete item Add CREATE SCHEMA ... LIKE that copies a schema

Incomplete item Fix CREATE OR REPLACE FUNCTION to not leave objects depending on the function in inconsistent state

Incomplete item Allow temporary tables to exist as empty by default in all sessions

Incomplete item Allow the creation of "distinct" types

Incomplete item Consider analyzing temporary tables when they are first used in a query

Autovacuum cannot analyze or vacuum temporary tables.

UPDATE

Incomplete item Research self-referential UPDATEs that see inconsistent row versions in read-committed mode

Incomplete item Improve performance of EvalPlanQual mechanism that rechecks already-updated rows

This is related to the previous item, which questions whether it even has the right semantics

ALTER

Incomplete item Have ALTER TABLE RENAME of a SERIAL column rename the sequence

Incomplete item Add ALTER DOMAIN to modify the underlying data type

Incomplete item Allow ALTER TABLESPACE to move the tablespace to different directories

Incomplete item Allow moving system tables to other tablespaces, where possible

Currently non-global system tables must be in the default database tablespace. Global system tables can never be moved.

Incomplete item Have ALTER INDEX update the name of a constraint using that index

Incomplete item Allow column display reordering by recording a display, storage, and permanent id for every column?

Incomplete item Allow deactivating (and reactivating) indexes via ALTER TABLE

Incomplete item Add ALTER OPERATOR ... RENAME

needs to consider effects of changing operator precedence

CLUSTER

Incomplete item Automatically maintain clustering on a table

This might require some background daemon to maintain clustering during periods of low usage. It might also require tables to be only partially filled for easier reorganization. Another idea would be to create a merged heap/index data file so an index lookup would automatically access the heap data too. A third idea would be to store heap rows in hashed groups, perhaps using a user-supplied hash function.

Incomplete item  Allow CLUSTER to be used on partial indexes

COPY

Incomplete item Allow COPY to report error lines and continue

This requires the use of a savepoint before each COPY line is processed, with ROLLBACK on COPY failure.

Incomplete item Allow COPY to report errors sooner

Incomplete item Allow COPY FROM to create index entries in bulk

Incomplete item Improve COPY performance

Incomplete item Allow a stalled COPY to exit if the backend is terminated

Incomplete item Allow COPY "text" format to output a header

Incomplete item Have COPY FREEZE set PD_ALL_VISIBLE

GRANT/REVOKE

Incomplete item Allow dropping of a role that has connection rights

DECLARE CURSOR

Incomplete item Prevent DROP TABLE from dropping a table referenced by its own open cursor?

Incomplete item Provide some guarantees about the behavior of cursors that invoke volatile functions

SHOW/SET

Incomplete item Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM ANALYZE, and CLUSTER

Incomplete item Rationalize the discrepancy between settings that use values in bytes and SHOW that returns the object count

ANALYZE

Incomplete item Improve how ANALYZE computes in-doubt tuples

Incomplete item Remove quadratic time in statistics sender when analyzing many tables

Incomplete item Reduce memory use when analyzing many tables in a single command by making catcache and syscache flushable or bounded.

EXPLAIN

Incomplete item Have EXPLAIN ANALYZE issue NOTICE messages when the estimated and actual row counts differ by a specified percentage

Incomplete item Have EXPLAIN ANALYZE report rows as floating-point numbers

Incomplete item Have EXPLAIN ANALYZE report buckets and memory usage for HashAggregate


Window Functions

See TODO items for window functions.

Incomplete item Support creation of user-defined window functions

We have the ability to create new window functions written in C. Is it worth the effort to create an API that would let them be written in PL/pgsql, etc?

Incomplete item Implement full support for window framing clauses

In addition to done clauses described in the latest doc, these clauses are not implemented yet.

  • RANGE BETWEEN ... PRECEDING/FOLLOWING
  • EXCLUDE

Incomplete item Investigate tuplestore performance issues

The tuplestore_in_memory() thing is just a band-aid, we ought to try to solve it properly. tuplestore_advance seems like a weak spot as well.

Incomplete item Do we really need so much duplicated code between Agg and WindowAgg?

Incomplete item Teach planner to evaluate multiple windows in the optimal order

Currently windows are always evaluated in the query-specified order.

Incomplete item Implement DISTINCT clause in window aggregates

Some proprietary RDBMSs have implemented it already, so it helps with porting from those.

Integrity Constraints

Keys

Incomplete item Improve deferrable unique constraints for cases with many conflicts

The current implementation fires a trigger for each potentially conflicting row. This might not scale well for an update that changes many key values at once.

Referential Integrity

Incomplete item Add MATCH PARTIAL referential integrity

Incomplete item Change foreign key constraint for array -> element to mean element in array?

Incomplete item Fix problem when cascading referential triggers make changes on cascaded tables, seeing the tables in an intermediate state

Incomplete item Are ri_KeysEqual checks in the RI enforcement triggers still necessary?

Check Constraints

Incomplete item Run check constraints only when affected columns are changed

Incomplete item Do not scan the table when a check constraint is added in the same command that adds the column

Server-Side Languages

Incomplete item Add support for polymorphic arguments and return types to languages other than PL/PgSQL

Incomplete item Add support for OUT and INOUT parameters to languages other than PL/PgSQL

Incomplete item Add more fine-grained specification of functions taking arbitrary data types

[D] Completed itemImplement stored procedures

This might involve the control of transaction state and the return of multiple result sets

Incomplete item Allow holdable cursors in SPI

Incomplete item Rethink query plan caching and timing of parse analysis within SQL-language functions

They should work more like plpgsql functions do ...

Incomplete item Allow regex operations in PL/Perl using UTF8 characters in non-UTF8 encoded databases

PL/pgSQL

Incomplete item Allow handling of %TYPE arrays, e.g. tab.col%TYPE[]

Incomplete item Allow listing of record column names, and access to record columns via variables, e.g. columns := r.(*), tval2 := r.(colname)

Incomplete item Allow row and record variables to be set to NULL constants, and allow NULL tests on such variables

Because a row is not scalar, do not allow assignment from NULL-valued scalars.

Incomplete item Consider keeping separate cached copies when search_path changes

Incomplete item Improve handling of NULL row values vs. NULL rows

Incomplete item Improve PERFORM handling of WITH queries or document limitation

PL/Python

Incomplete item Create a new restricted execution class that will allow passing function arguments in as locals. Passing them as globals means functions cannot be called recursively.

Incomplete item Add a DB-API compliant interface on top of the SPI interface

Incomplete item For functions returning a setof record with a composite type, cache the I/O functions for the composite type

Clients

Incomplete item Split out pg_resetxlog output into pre- and post-sections

Incomplete item Improve pg_rewind

psql

Incomplete item Move psql backslash database information into the backend, use mnemonic commands?

This would allow non-psql clients to pull the same information out of the database as psql.

Incomplete item Make psql's \d commands distinguish default privileges from no privileges

ACL displays were visibly different for the two cases before we "improved" them by using array_to_string.

Incomplete item Consistently display privilege information for all objects in psql

[D] Completed item\s without arguments (display history) fails with libedit, doesn't use pager either

This items has been fixed in commit 750c5e.
Fix psql \s to work with recent libedit, and add pager support.

psql's \s (print command history) doesn't work at all with recent libedit versions when printing to the terminal, because libedit tries to do an fchmod() on the target file which will fail if the target is /dev/tty. (We'd already noted this in the context of the target being /dev/null.) Even before that, it didn't work pleasantly, because libedit likes to encode the command history file (to ensure successful reloading), which renders it nigh unreadable, not to mention significantly different-looking depending on exactly which libedit version you have. So let's forget using write_history() for this purpose, and instead print the data ourselves, using logic similar to that used to iterate over the history for newline encoding/decoding purposes.

While we're at it, insert the ability to use the pager when \s is printing to the terminal. This has been an acknowledged shortcoming of \s for many years, so while you could argue it's not exactly a back-patchable bug fix it still seems like a good improvement. Anyone who's seriously annoyed at this can use "\s /dev/tty" or local equivalent to get the old behavior.

Experimentation with this showed that the history iteration logic was actually rather broken when used with libedit. It turns out that with libedit you have to use previous_history() not next_history() to advance to more recent history entries. The easiest and most robust fix for this seems to be to make a run-time test to verify which function to call. We had not noticed this because libedit doesn't really need the newline encoding logic: its own encoding ensures that command entries containing newlines are reloaded correctly (unlike libreadline). So the effective behavior with recent libedits was that only the oldest history entry got newline-encoded or newline-decoded. However, because of yet other bugs in history_set_pos(), some old versions of libedit allowed the existing loop logic to reach entries besides the oldest, which means there may be libedit ~/.psql_history files out there containing encoded newlines in more than just the oldest entry. To ensure we can reload such files, it seems appropriate to back-patch this fix, even though that will result in some incompatibility with older psql versions (ie, multiline history entries written by a psql with this fix will look corrupted to a psql without it, if its libedit is reasonably up to date).

Stepan Rutz and Tom Lane

Incomplete item Add a \set variable to control whether \s displays line numbers

Another option is to add \# which lists line numbers, and allows command execution.

Incomplete item Include the symbolic SQLSTATE name in verbose error reports

Incomplete item Add option to wrap column values at whitespace boundaries, rather than chopping them at a fixed width.

Currently, "wrapped" format chops values into fixed widths. Perhaps the word wrapping could use the same algorithm documented in the W3C specification.

Incomplete item Add option to print advice for people familiar with other databases

Incomplete item Fix FETCH_COUNT to handle SELECT ... INTO and WITH queries

Incomplete item Prevent psql from sending remaining single-line multi-statement queries after reconnecting

Incomplete item Improve line drawing characters

Incomplete item Consider improving the continuation prompt

Incomplete item Improve speed of tab completion by using LIKE

pg_dump / pg_restore

[E] Incomplete item Dump security labels and comments on databases in a way that allows to load a dump into a differently named database

[E] Incomplete item Add full object name to the tag field. eg. for operators we need '=(integer, integer)', instead of just '='.

Incomplete item Avoid using platform-dependent names for locales in pg_dumpall output

Using native locale names puts roadblocks in the way of porting a dump to another platform. One possible solution is to get CREATE DATABASE to accept some agreed-on set of locale names and fix them up to meet the platform's requirements.

Incomplete item In a selective dump, allow dumping of an object and all its dependencies

Incomplete item Stop dumping CASCADE on DROP TYPE commands in clean mode

Incomplete item Allow pg_restore to load different parts of the COPY data for a single table simultaneously

[D] Completed itemRefactor handling of database attributes between pg_dump and pg_dumpall

Currently only pg_dumpall emits database attributes, such as ALTER DATABASE SET commands and database-level GRANTs. Many people wish that pg_dump would do that. One proposal is to let pg_dump issue such commands if the -C switch was used, but it's unclear whether that will satisfy the demand.

Incomplete item Preserve sparse storage of large objects over dump/restore

Incomplete item Prevent PL/pgSQL comment from throwing an error in a non-superuser restore

Incomplete item Delay REFRESH MATERIALIZED VIEW until dependent indexes are created

pg_upgrade

Incomplete item Handle large object comments

This is difficult to do because the large object doesn't exist when --schema-only is loaded.

Incomplete item Consider using pg_depend for checking object usage in version.c

Incomplete item Migrate pg_statistic by dumping it out as a flat file, so analyze is not necessary

Incomplete item Find cleaner way to start/stop dedicated servers for upgrades

Incomplete item Desired changes that would prevent upgrades with pg_upgrade

ecpg

Incomplete item Docs

Document differences between ecpg and the SQL standard and information about the Informix-compatibility module.

Incomplete item Solve cardinality > 1 for input descriptors / variables?

Incomplete item Add a semantic check level, e.g. check if a table exists

Incomplete item fix handling of DB attributes that are arrays

Incomplete item Fix nested C comments

[E] Incomplete item sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified

Incomplete item Make SET CONNECTION thread-aware, non-standard?

Incomplete item Allow multidimensional arrays

Incomplete item Implement COPY FROM STDIN

Incomplete item Provide a way to specify size of a bytea parameter

[E] Incomplete item Fix small memory leaks in ecpg

Memory leaks in a short running application like ecpg are not really a problem, but make debugging more complicated

Incomplete item Allow reuse of cursor name variables

libpq

Incomplete item Prevent PQfnumber() from lowercasing unquoted column names

PQfnumber() should never have been doing lowercasing, but historically it has so we need a way to prevent it

Incomplete item Consider disallowing multiple queries in PQexec() as an additional barrier to SQL injection attacks

Incomplete item Add PQexecf() that allows complex parameter substitution

Incomplete item Add SQLSTATE and severity to errors generated within libpq itself

Incomplete item Add support for interface/ipaddress binding to libpq

Incomplete item When receiving a FATAL error remember it, so that it doesn't profess ingnorance about why the session was closed

Incomplete item Pipelining support for libpq async API and an array-valued PQexecPrepared that uses it

Triggers

Incomplete item Improve storage of deferred trigger queue

Right now all deferred trigger information is stored in backend memory. This could exhaust memory for very large trigger queues. This item involves dumping large queues into files, or doing some kind of join to process all the triggers, some bulk operation, or a bitmap.

Incomplete item Allow triggers to be disabled in only the current session.

This is currently possible by starting a multi-statement transaction, modifying the system tables, performing the desired SQL, restoring the system tables, and committing the transaction. ALTER TABLE ... TRIGGER requires a table lock so it is not ideal for this usage.

Incomplete item With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY

If the dump is known to be valid, allow foreign keys to be added without revalidating the data.

Incomplete item When statement-level triggers are defined on a parent table, have them fire only on the parent table, and fire child table triggers only where appropriate

Incomplete item Tighten trigger permission checks

Incomplete item Allow BEFORE INSERT triggers on views

Incomplete item Add database and transaction-level triggers

Incomplete item Avoid requirement for AFTER trigger functions to return a value

Incomplete item Allow creation of inline triggers

Inheritance

Incomplete item Allow inherited tables to inherit indexes, UNIQUE constraints, and primary/foreign keys

Incomplete item Allow unique indexes across inherited tables (requires multi-table indexes)

  • Postgres 11 allows unique indexes across partitions if the partition key is part of the index.

Incomplete item Research whether ALTER TABLE / SET SCHEMA should work on inheritance hierarchies (and thus support ONLY)

Incomplete item ALTER TABLE variants sometimes support recursion and sometimes not, but this is poorly/not documented, and the ONLY marker would then be silently ignored. Clarify the documentation, and reject ONLY if it is not supported.

Indexes

Incomplete item Prevent index uniqueness checks when UPDATE does not modify the column

Uniqueness (index) checks are done when updating a column even if the column is not modified by the UPDATE. However, HOT already short-circuits this in common cases, so more work might not be helpful.

Incomplete item Allow accurate statistics to be collected on indexes with more than one column or expression indexes, perhaps using per-index statistics

Incomplete item Consider having a larger statistics target for indexed columns and expression indexes.

Incomplete item Add REINDEX CONCURRENTLY, like CREATE INDEX CONCURRENTLY

This is difficult because you must upgrade to an exclusive table lock to replace the existing index file. CREATE INDEX CONCURRENTLY does not have this complication. This would allow index compaction without downtime.

Incomplete item Allow multiple indexes to be created concurrently, ideally via a single heap scan

pg_restore allows parallel index builds, but it is done via subprocesses, and there is no SQL interface for this. Cluster could definitely benefit from this.

Incomplete item Consider sorting entries before inserting into btree index

Incomplete item Consider using "effective_io_concurrency" for index scans

Currently only bitmap scans use this, which might be fine because most multi-row index scans use bitmap scans.

Incomplete item Allow GIN indexes to be used for exclusion constraints

Incomplete item  Allow "loose" or "skip" scans on btree indexes in which the first column has low cardinality

Incomplete item  Make the planner's "special index operator" mechanism extensible

Incomplete item  Allow index-only COUNT(*) for indexes which don't support index-only scans

Incomplete item Improve GIN performance

Incomplete item  Teach GIN cost estimation about "fast scans"

Incomplete item  Allow unlogged indexes

GIST

Incomplete item Add more GIST index support for geometric data types

Incomplete item Allow GIST indexes to create more complex index types, like digital trees (see Aoki)

Incomplete item Fix performance issues in contrib/seg and contrib/cube GiST support

Incomplete item GiST index support for arrays

Hash

Incomplete item Add UNIQUE capability to hash indexes

Incomplete item Allow multi-column hash indexes

Sorting

Incomplete item Consider whether duplicate keys should be sorted by block/offset

Incomplete item Consider being smarter about memory and external files used during sorts

Incomplete item Consider detoasting keys before sorting

Incomplete item Allow sorts of skinny tuples to use even more available memory.

Now that it is not limited by MaxAllocSize, don't limit by INT_MAX either.

Cache Usage

Incomplete item Consider automatic caching of statements at various levels:

Incomplete item Consider allowing higher priority queries to have referenced shared buffer pages stay in memory longer

Incomplete item Fix memory leak caused by negative catcache entries

Vacuum

Incomplete item Auto-fill the free space map by scanning the buffer cache or by checking pages written by the background writer

Incomplete item Allow concurrent inserts to use recently created pages rather than creating new ones

Incomplete item Consider having single-page pruning update the visibility map

Incomplete item Allow VACUUM FULL and CLUSTER to update the visibility map

Incomplete item Improve tracking of total relation tuple counts now that vacuum doesn't always scan the whole heap

Incomplete item Bias FSM towards returning free space near the beginning of the heap file, in hopes that empty pages at the end can be truncated by VACUUM

Incomplete item Consider a more compact data representation for dead tuple locations within VACUUM

Incomplete item Provide more information in order to improve user-side estimates of dead space bloat in relations

Incomplete item Reduce the number of table scans performed by vacuum

Incomplete item Vacuum Gin indexes in physically order rather than logical order

Incomplete item Avoid creation of the free space map for small tables

Auto-vacuum

Incomplete item Issue log message to suggest VACUUM FULL if a table is nearly empty?

Incomplete item Prevent long-lived temporary tables from causing frozen-xid advancement starvation

The problem is that autovacuum cannot vacuum them to set frozen xids; only the session that created them can.

Incomplete item Prevent autovacuum from running if an old transaction is still running from the last vacuum

Incomplete item Have autoanalyze of parent tables occur when child tables are modified

Incomplete item Allow visibility map all-visible bits to be set even when an auto-ANALYZE is running

Incomplete item Improve autovacuum tuning

Incomplete item Improve setting of visibility map bits for read-only and insert-only workloads

Locking

Incomplete item Fix problem when multiple subtransactions of the same outer transaction hold different types of locks, and one subtransaction aborts

Incomplete item Improve deadlock detection when a page cleaning lock conflicts with a shared buffer that is pinned

Incomplete item Detect deadlocks involving LockBufferForCleanup()

Incomplete item Allow finer control over who is cancelled in a deadlock

Startup Time Improvements

Incomplete item Allow backends to change their database without restart

This allows for faster server startup.

Write-Ahead Log

Incomplete item Eliminate need to write full pages to WAL before page modification

Currently, to protect against partial disk page writes, we write full page images to WAL before they are modified so we can correct any partial page writes during recovery. These pages can also be eliminated from point-in-time archive files.

Incomplete item When full page writes are off, write CRC to WAL and check file system blocks on recovery

If CRC check fails during recovery, remember the page in case a later CRC for that page properly matches. The difficulty is that hint bits are not WAL logged, meaning a valid page might not match the earlier CRC.

Incomplete item Write full pages during file system write and not when the page is modified in the buffer cache

This allows most full page writes to happen in the background writer. It might cause problems for applying WAL on recovery into a partially-written page, but later the full page will be replaced from WAL.

Incomplete item Allow WAL information to recover corrupted pg_controldata

Incomplete item Speed WAL recovery by allowing more than one page to be prefetched

This should be done utilizing the same infrastructure used for prefetching in general to avoid introducing complex error-prone code in WAL replay.

Incomplete item Improve WAL concurrency by increasing lock granularity

Incomplete item Have resource managers report the duration of their status changes

Incomplete item Close deleted WAL files held open in *nix by long-lived read-only backends

Optimizer / Executor

Incomplete item Improve selectivity functions for geometric operators

Incomplete item Consider increasing the default values of from_collapse_limit, join_collapse_limit, and/or geqo_threshold

Incomplete item Improve ability to display optimizer analysis using OPTIMIZER_DEBUG

Incomplete item Log statements where the optimizer row estimates were dramatically different from the number of rows actually found?

Incomplete item Consider compressed annealing to search for query plans

This might replace GEQO.

Incomplete item Improve use of expression indexes for ORDER BY

Incomplete item Modify the planner to better estimate caching effects

Incomplete item Allow shared buffer cache contents to affect index cost computations

Incomplete item Allow the CTE (Common Table Expression) optimization fence to be optionally disabled

Hashing

Incomplete item Consider using a hash for joining to a large IN (VALUES ...) list

Incomplete item Allow single batch hash joins to preserve outer pathkeys

Incomplete item Use "lazy" hash tables to look up only the tuples that are actually requested

Incomplete item Avoid building the same hash table more than once during the same query

Incomplete item Avoid hashing for distinct and then re-hashing for hash join

Background Writer

Incomplete item Consider having the background writer update the transaction status hint bits before writing out the page

Implementing this requires the background writer to have access to system catalogs and the transaction status log.

Incomplete item Consider adding buffers the background writer finds reusable to the free list

Incomplete item Automatically tune bgwriter_delay based on activity rather then using a fixed interval

Incomplete item Consider whether increasing BM_MAX_USAGE_COUNT improves performance

Incomplete item Test to see if calling PreallocXlogFiles() from the background writer will help with WAL segment creation latency

Concurrent Use of Resources

Incomplete item Do async I/O for faster random read-ahead of data

Async I/O allows multiple I/O requests to be sent to the disk with results coming back asynchronously.

The above patch is already applied as of 8.4, but it still remains to figure out how to handle plain indexscans effectively.

Incomplete item SMP scalability improvements

TOAST

Incomplete item Allow user configuration of TOAST thresholds

Incomplete item Reduce unnecessary cases of deTOASTing

Incomplete item Reduce costs of repeat de-TOASTing of values

Monitoring

Incomplete item Have pg_stat_activity display query strings in the correct client encoding

Incomplete item  Add entry creation timestamp column to pg_stat_replication

Incomplete item  Allow reporting of stalls due to wal_buffer wrap-around

Incomplete item  Restructure pg_stat_database columns tup_returned and tup_fetched to return meaningful values

Incomplete item  Improve handling of pg_stat_statements handling of bind "IN" variables

Miscellaneous Performance

Incomplete item Use mmap() rather than shared memory for shared buffers?

This would remove the requirement for SYSV SHM but would introduce portability issues. Anonymous mmap (or mmap to /dev/zero) is required to prevent I/O overhead. We could also consider mmap() for writing WAL.

Incomplete item Rather than consider mmap()-ing in 8k pages, consider mmap()'ing entire files into a backend?

Doing I/O to large tables would consume a lot of address space or require frequent mapping/unmapping. Extending the file also causes mapping problems that might require mapping only individual pages, leading to thousands of mappings. Another problem is that there is no way to _prevent_ I/O to disk from the dirty shared buffers so changes could hit disk before WAL is written.

Incomplete item Allow configuration of backend priorities via the operating system

Though backend priorities make priority inversion during lock waits possible, research shows that this is not a huge problem.

Incomplete item Consider if CommandCounterIncrement() can avoid its AcceptInvalidationMessages() call

Incomplete item Consider Cartesian joins when both relations are needed to form an indexscan qualification for a third relation

Incomplete item Consider not storing a NULL bitmap on disk if all the NULLs are trailing

Incomplete item Sort large UPDATE/DELETEs so it is done in heap order

Incomplete item Add auto-tuning of work_mem

Incomplete item Consider decreasing the I/O caused by updating tuple hint bits

Incomplete item Avoid reading in b-tree pages when replaying vacuum records in hot standby mode

Incomplete item Restructure truncation logic to be more resistant to failure

This also involves not writing dirty buffers for a truncated or dropped relation

Incomplete item Enhance foreign data wrappers, parallelism, partitioning, and perhaps add a global snapshot/transaction manager to allow creation of a proof-of-concept built-in sharding solution

Ideally these enhancements and new facilities will be available to external sharding solutions as well.

Miscellaneous Other

Incomplete item Deal with encoding issues for filenames in the server filesystem

Incomplete item Deal with encoding issues in the output of localeconv()

Incomplete item Have GB18030 handle more than 2-byte Unicode code points

Incomplete item Provide schema name and other fields available from SQL GET DIAGNOSTICS in error reports

Incomplete item Use sa_mask to close race conditions between signal handlers

Incomplete item Allow pg_export_snapshot() to run on hot standby servers

This will allow parallel pg_dump on such servers.

Incomplete item Provide a way to enumerate and unregister background workers

Right now the only way to unregister bgworkers is from within the worker with proc_exit(0) or registering with BGW_NEVER_RESTART

Source Code

Incomplete item Allow cross-compiling by generating the zic database on the target system

Incomplete item Improve NLS maintenance of libpgport messages linked onto applications

Incomplete item Use UTF8 encoding for NLS messages so all server encodings can read them properly

Incomplete item Allow creation of universal binaries for Darwin

Incomplete item Consider GnuTLS if OpenSSL license becomes a problem

Incomplete item Consider making NAMEDATALEN more configurable

Incomplete item Research use of signals and sleep wake ups

Incomplete item Allow C++ code to more easily access backend code

Incomplete item Consider simplifying how memory context resets handle child contexts

Incomplete item Improve detection of shared memory segments being used by others by checking the SysV shared memory field 'nattch'

Incomplete item Implement the non-threaded Avahi service discovery protocol

Incomplete item Reduce data row alignment requirements on some 64-bit systems

Incomplete item Restructure TOAST internal storage format for greater flexibility

Incomplete item  Research different memory allocation methods for lists

Incomplete item  Consider removing the attribute options cache

Incomplete item  Restructure /contrib section

Windows

Incomplete item Remove configure.in check for link failure when the cause is found

Incomplete item Allow psql to use readline once non-US code pages work with backslashes

Incomplete item Improve signal handling

Incomplete item Support PGXS when using MSVC

Incomplete item Fix MSVC NLS support, like for to_char()

Incomplete item Fix global namespace issues when using multiple terminal server sessions

Incomplete item Change from the current autoconf/gmake build system to cmake

Incomplete item Improve consistency of path separator usage

Incomplete item Fix cross-compiling on Windows

Incomplete item Reduce file statistics overhead on directory reads

Incomplete item Fix hang with long file paths

Wire Protocol Changes / v4 Protocol


Incomplete item Allow dynamic character set handling

Incomplete item Ensure the client can determine the encoding of messages sent early in the handshake

Incomplete item Let the client indicate character encoding of database names, user names, passwords, and of pre-auth error messages returned by the server

Incomplete item Send numeric version to clients in fixed header

Incomplete item Add decoded type length/precision (i.e. typmod information)

Incomplete item Mark result columns as known-not-null when possible

Incomplete item Use compression

Specify and implement wire protocol compression. If SSL transparent compression is used, hopefully avoid the overhead of key negotiation and encryption when SSL is configured only for compression. Note that compression is being removed from TLS 1.3 so we really need to do it ourselves.

Incomplete item Update clients to use data types, typmod, schema.table.column names of result sets using new statement protocol

Incomplete item Set protocol for wire format negotiation

Incomplete item Make sure upgrading to a 4.1 protocol version will actually work smoothly

Incomplete item Allow multi-state authentication (e.g. try client peer, fall back to md5)

Incomplete item Allow re-authentication

Let the client request re-authentication as a different user mid session, for connection pools that pass through the handshake.

Incomplete item Identify the affected object in CommandComplete message?

Incomplete item Allow negotiation of encryption, STARTTLS style, rather than forcing client to decide on SSL or !SSL before connecting

Incomplete item Permit lazy fetches of large values, at least out-of-line TOASTED values

Incomplete item Add session-level whitelisting of types for binary-mode transfer

Incomplete item Send client the xid when it is allocated

Lets the client later ask the server "did this commit or not?" after interterminate result due to crash or connection loss

Incomplete item Report xlog position in commit message

Help enable client-side failover by providing a token clients can use to see if a commit has replayed to replicas yet

Incomplete item Changes to make cancellations more reliable and more secure

Incomplete item Clarify semantics of statement_timeout in extended query protocol

Batched and pipelined queries have unexpected behaviour with statement_timeout. Client needs to be able to specify statement boundary with protocol message.

Incomplete item Create a more efficient way to handle out-of-line parameters

Incomplete item Separate transaction delineation from protocol error recovery (in v3 both are managed via the same Sync message)

Documentation

Incomplete item Provide a manpage for postgresql.conf

Incomplete item Document support for N' ' national character string literals, if it matches the SQL standard

Incomplete item Add diagrams to the documentation

Exotic Features

Incomplete item Add pre-parsing phase that converts non-ISO syntax to supported syntax

This could allow SQL written for other databases to run without modification.

Incomplete item Allow plug-in modules to emulate features from other databases

Incomplete item Add features of Oracle-style packages

A package would be a schema with session-local variables, public/private functions, and initialization functions. It is also possible to implement these capabilities in any schema and not use a separate "packages" syntax at all.

Incomplete item Consider allowing control of upper/lower case folding of unquoted identifiers

Incomplete item Add autonomous transactions

Incomplete item Give query progress indication

Incomplete item Rethink our type system

Features We Do Not Want

The following features have been discussed ad nauseum on the PostgreSQL mailing lists and the consensus has been that the project is not interested in them. As such, if you are going to bring them up as potential features, you will want to be familiar with all of the arguments against these features which have been previously made over the years. If you decide to work on such features anyway, you should be aware that you face a higher-than-normal barrier to get the Project to accept them.

Incomplete item All backends running as threads in a single process (not wanted)

This eliminates the process protection we get from the current setup. Thread creation is usually the same overhead as process creation on modern systems, so it seems unwise to use a pure threaded model, and MySQL and DB2 have demonstrated that threads introduce as many issues as they solve. Threading specific operations such as I/O, seq scans, and connection management has been discussed and will probably be implemented to enable specific performance features. Moving to a threaded engine would also require halting all other work on PostgreSQL for one to two years.

Incomplete item "Oracle-style" optimizer hints (not wanted)

Optimizer hints, as implemented in Oracle and other RDBMSes, are used to work around problems in the optimizer and introduce upgrade and maintenance issues. We would rather have such problems reported and fixed. We have discussed a more sophisticated system of per-class cost adjustment instead, but a specification remains to be developed. See Optimizer Hints Discussion for further information.

Incomplete item Embedded server (not wanted)

While PostgreSQL clients runs fine in limited-resource environments, the server requires multiple processes and a stable pool of resources to run reliably and efficiently. Stripping down the PostgreSQL server to run in the same process address space as the client application would add too much complexity and failure cases. Besides, there are several very mature embedded SQL databases already available.

Incomplete item Obfuscated function source code (not wanted)

Obfuscating function source code has minimal protective benefits because anyone with super-user access can find a way to view the code. At the same time, it would greatly complicate backups and other administrative tasks. To prevent non-super-users from viewing function source code, remove SELECT permission on pg_proc.

Incomplete item Indeterminate behavior for the GROUP BY clause (not wanted)

At least one other database product allows specification of a subset of the result columns which GROUP BY would need to be able to provide predictable results; the server is free to return any value from the group. This is not viewed as a desirable feature. PostgreSQL 9.1 allows result columns that are not referenced by GROUP BY if a primary key for the same table is referenced in GROUP BY.

Incomplete item On-disk bitmap indexes (not wanted)

The rigidity of on-disk bitmap indexes, and the existence of GIN and in-memory bitmaps make this undesirable.

Personal tools