Todo

From PostgreSQL wiki
(Redirected from XPath Todo)
Jump to navigationJump to search

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 incomplete items
  • [D] Completed item - marks changes that are done, and will appear in the PostgreSQL 17 release.

Over time, it may become clear that a TODO item has become outdated or otherwise determined to be either too controversial or not worth the development effort. Such items should be retired to the Not Worth Doing page.

For help on editing this list, please see Talk:Todo. Please do not add or remove 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 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 Prevent query cancel packets from being replayed by an attacker, especially when using SSL
Incomplete item  Maintain an approximate xid->"time of assignment" mapping. This would allow controlling the maximum effect of hot_standby_feedback on the primary, and would be useful for other features.

Tablespaces

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 tablespaces on RAM-based partitions for unlogged tables
Incomplete item Allow toast tables to be moved to a different tablespace

Statistics Collector

Incomplete item Testing pgstat via pg_regress is tricky and inefficient. Consider making a dedicated pgstat test-suite.
Incomplete item Teach stats collector to differentiate between internal and leaf index pages

SSL

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

Standby server mode

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

Data Types

Incomplete item Add support for public SYNONYMs
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

Arrays

Incomplete item Allow single-byte header storage for array elements

Text Search

Incomplete item Consider changing error to warning for strings larger than one megabyte
Incomplete item Improve default parser, to more easily allow adding new tokens
Incomplete item Add additional support functions

XML

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 Add functions from SQL:2006: XMLDOCUMENT, XMLCAST, XMLTEXT
Incomplete item Add XMLNAMESPACES support in XMLELEMENT and elsewhere
Incomplete item Report errors returned by the XSLT library
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 Verify Xpath escaping behavior

Functions

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 Fix /contrib/btree_gist's implementation of inet indexing
Incomplete item Add array_sort function
  • Probably beginner-friendly, given that we already have array_shuffle and intarray::sort to reference. Plus most everything is order-able due to btree indexes.

Multi-Language Support

Incomplete item Add NCHAR (as distinguished from ordinary varchar)
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 Support multiple simultaneous character sets, per SQL:2008
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

Views and Rules

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 Allow NOTIFY in rules involving conditionals
Incomplete item Allow NOTIFY to handle transaction wraparound
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 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 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
Incomplete item Add system that disables HOT and block-local updates when there are significant amounts of free space earlier in the table, and automates updating the tuples in the tail of the table.
This moves tuples more to the front of the table, increasing the chance a subsequent VACUUM operation can truncate parts of the table.

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 errors sooner
Incomplete item Allow COPY FROM to create index entries in bulk
Incomplete item Allow a stalled COPY to exit if the backend is terminated

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 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 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 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
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 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 Consistently display privilege information for all objects in psql
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 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 speed of tab completion by using LIKE
Incomplete item Add handling of Unicode grapheme clusters

pg_dump / pg_restore

Incomplete item Dump security labels and comments on databases in a way that allows to load a dump into a differently named database
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
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
Incomplete item Remove or document the behavior of --data-only

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 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
Incomplete item Allow reuse of cursor name variables

libpq

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 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 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 Consider having a larger statistics target for indexed columns and expression indexes.
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" scans on btree indexes in which the first column has low cardinality
Incomplete item Allow "skip" scans on multi-column btree indexes This means applying techniques similar to those detailed in the Multidimensional Access Method (MDAM) paper
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 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
Incomplete item Better regexp cache management:
  • This would be fairly isolated, but involve memory management, error handling, data structures, GUCs.
  • Each backend has a cache of compiled regular expressions.  If you run
    SELECT 'abc' ~ 'a.c'
    , then
    SELECT ident FROM pg_backend_memory_contexts WHERE name = 'RegexpMemoryContext'
    will show the cached expression.
  • Currently the size of the cache is fixed at MAX_CACHED_RES (32), and the array of cached expressions is searched linearly by RE_compile_and_cache(), with a performance mitigation that recently used expressions are moved to the front of the array.  An application making heavy use of regular expressions might want to increase the limit, possibly expressing it using something like
    SET regexp_cache_size='1MB'
    , and to index it with a hash table, possibly using simplehash.h, while still maintaining an LRU list, possibly using dlist.

Vacuum

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 Add a way to compact tables without exclusive locking, similar to pre-9.0 VACUUM FULL
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 autoanalyze thresholds for small tables
Incomplete item Make autovacuum scheduling smarter

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
Incomplete item Use less bytes to store the information of WAL records.
The WAL record format is quite verbose, and often contains more bytes than necessary for redo and decoding. By updating the WAL format we can reduce the average WAL record size of e.g. pgbench by several percent.

Optimizer / Executor

Incomplete item Improve selectivity functions for geometric operators
Incomplete item Consider adding a useful and convenient way of seeing paths rejected by the planner. OPTIMIZER_DEBUG does this so some extent but it seemingly gets very little use and must be enabled during compilation.
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 Add planner support for cardinality-reducing functions
estimate_num_groups currently assumes (under item 2 in its header comment) that any function on an attribute won't meaningfully decrease the cardinality (number of groups) generated from that attribute, i.e. num_groups(a) ~= num_groups(f(a)). However, for truncating functions such as int4mod, date_trunc, or date_bin, this assumption is wrong and will result in plans that can significnatly overestimate the number of groups.

Hashing

Incomplete item Allow single batch hash joins to preserve outer pathkeys
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.

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  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 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.
Incomplete item Consider a built-in connection pooler

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 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 Rationalize division of labor between initdb and bootstrap
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 Consider making NAMEDATALEN more configurable
There is demand for making 128 the default, but there are also concerns about storage and memory usage and performance. So a rearchitecting to make the storage variable-length might be preferred.
Incomplete item Research use of signals and sleep wake ups
Incomplete item Consider simplifying how memory context resets handle child contexts
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  Consider removing the attribute options cache
Incomplete item  Restructure /contrib section

Windows

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 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

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 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 Add autonomous transactions
Incomplete item Give query progress indication