4 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
5 Last updated: Sat Apr 29 21:45:16 EDT 2006
7 The most recent version of this document can be viewed at
8 http://www.postgresql.org/docs/faqs.TODO.html.
10 #A hyphen, "-", marks changes that will appear in the upcoming 8.2 release.#
11 #A percent sign, "%", marks items that are easier to implement.#
13 Bracketed items, "[]", have more detail.
15 This list contains all known PostgreSQL bugs and feature requests. If
16 you would like to work on an item, please read the Developer's FAQ
23 * %Remove behavior of postmaster -o
24 * -%Allow pooled connections to list all prepared statements
26 This would allow an application inheriting a pooled connection to know
27 the statements prepared in the current session.
29 * Allow major upgrades without dump/reload, perhaps using pg_upgrade
31 * Check for unreferenced table files created by transactions that were
32 in-progress when the server terminated abruptly
33 * Allow administrators to safely terminate individual sessions either
34 via an SQL function or SIGTERM
36 Lock table corruption following SIGTERM of an individual backend
37 has been reported in 8.0. A possible cause was fixed in 8.1, but
38 it is unknown whether other problems exist. This item mostly
39 requires additional testing rather than of writing any new code.
41 * %Set proper permissions on non-system schemas during db creation
43 Currently all schemas are owned by the super-user because they are
44 copied from the template1 database.
46 * Support table partitioning that allows a single table to be stored
47 in subtables that are partitioned based on the primary key or a WHERE
49 * Add function to report the time of the most recent server reload
50 * Allow statistics collector information to be pulled from the collector
51 process directly, rather than requiring the collector to write a
52 filesystem file twice a second?
53 * Allow log_min_messages to be specified on a per-module basis
55 This would allow administrators to see more detailed information from
56 specific sections of the backend, e.g. checkpoints, autovacuum, etc.
57 Another idea is to allow separate configuration files for each module,
58 or allow arbitrary SET commands to be passed to them.
60 * -Re-enable the GUC full_page_writes in 8.2 when reliability issues have
64 * Improve replication solutions
68 You can use any of the master/slave replication servers to use a
69 standby server for data warehousing. To allow read/write queries to
70 multiple servers, you need multi-master replication like pgcluster.
72 o Allow replication over unreliable or non-persistent links
77 o -Add "include file" functionality in postgresql.conf
78 o %Allow commenting of variables in postgresql.conf to restore them
81 Currently, if a variable is commented out, it keeps the
82 previous uncommented value until a server restarted.
84 o %Allow per-database permissions to be set via GRANT
86 Allow database connection checks based on GRANT rules in
87 addition to the existing access checks in pg_hba.conf.
89 o Allow pg_hba.conf to specify host names along with IP addresses
91 Host name lookup could occur when the postmaster reads the
92 pg_hba.conf file, or when the backend starts. Another
93 solution would be to reverse lookup the connection IP and
94 check that hostname against the host names in pg_hba.conf.
95 We could also then check that the host name maps to the IP
98 o %Allow postgresql.conf file values to be changed via an SQL
99 API, perhaps using SET GLOBAL
100 o Allow the server to be stopped/restarted via an SQL API
101 o -Issue a warning if a change-on-restart-only postgresql.conf value
102 is modified and the server config files are reloaded
103 o Mark change-on-restart-only values in postgresql.conf
108 * Allow a database in tablespace t1 with tables created in
109 tablespace t2 to be used as a template for a new database created
110 with default tablespace t2
112 All objects in the default database tablespace must have default
113 tablespace specifications. This is because new databases are
114 created by copying directories. If you mix default tablespace
115 tables and tablespace-specified tables in the same directory,
116 creating a new database from such a mixed directory would create a
117 new database with tables that had incorrect explicit tablespaces.
118 To fix this would require modifying pg_class in the newly copied
119 database, which we don't currently do.
121 * Allow reporting of which objects are in which tablespaces
123 This item is difficult because a tablespace can contain objects
124 from multiple databases. There is a server-side function that
125 returns the databases which use a specific tablespace, so this
126 requires a tool that will call that function and connect to each
127 database to find the objects in each database for that tablespace.
129 o %Add a GUC variable to control the tablespace for temporary objects
132 It could start with a random tablespace from a supplied list and
133 cycle through the list.
135 o Allow WAL replay of CREATE TABLESPACE to work when the directory
136 structure on the recovery computer is different from the original
138 o Allow per-tablespace quotas
141 * Point-In-Time Recovery (PITR)
143 o Allow point-in-time recovery to archive partially filled
144 write-ahead logs [pitr]
146 Currently only full WAL files are archived. This means that the
147 most recent transactions aren't available for recovery in case
148 of a disk failure. This could be triggered by a user command or
151 o Automatically force archiving of partially-filled WAL files when
152 pg_stop_backup() is called or the server is stopped
154 Doing this will allow administrators to know more easily when
155 the archive contains all the files needed for point-in-time
158 o %Create dump tool for write-ahead logs for use in determining
159 transaction id for point-in-time recovery
160 o Allow a warm standby system to also allow read-only statements
163 This is useful for checking PITR recovery.
165 o Allow the PITR process to be debugged and data examined
166 o Add reporting of the current WAL file, perhaps as part of
167 partial log file archiving
173 * Allow server log information to be output as INSERT statements
175 This would allow server log information to be easily loaded into
176 a database for analysis.
178 * %Add ability to monitor the use of temporary sort files
179 * Allow server logs to be remotely read and removed using SQL commands
180 * Allow protocol-level BIND parameter values to be logged
186 * Improve the MONEY data type
188 Change the MONEY data type to use DECIMAL internally, with special
189 locale-aware output formatting.
191 * Change NUMERIC to enforce the maximum precision
192 * Add NUMERIC division operator that doesn't round?
194 Currently NUMERIC _rounds_ the result to the specified precision.
195 This means division can return a result that multiplied by the
196 divisor is greater than the dividend, e.g. this returns a value > 10:
198 SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
200 The positive modulus result returned by NUMERICs might be considered
201 inaccurate, in one sense.
203 * %Disallow changing default expression of a SERIAL column?
204 * %Disallow ALTER SEQUENCE changes for SERIAL sequences because pg_dump
205 does not dump the changes
206 * Fix data types where equality comparison isn't intuitive, e.g. box
207 * -Zero umasked bits in conversion from INET cast to CIDR
208 * -Prevent INET cast to CIDR from dropping netmask, SELECT '1.1.1.1'::inet::cidr
209 * -Allow INET + INT8 to increment the host part of the address or
210 throw an error on overflow
211 * -Add 'tid != tid ' operator for use in corruption recovery
212 * Allow user-defined types to specify a type modifier at table creation
218 o Allow infinite dates and intervals just like infinite timestamps
219 o Merge hardwired timezone names with the TZ database; allow either
220 kind everywhere a TZ name is currently taken
221 o Allow customization of the known set of TZ names (generalize the
222 present australian_timezones hack)
223 o Allow TIMESTAMP WITH TIME ZONE to store the original timezone
224 information, either zone name or offset from UTC [timezone]
226 If the TIMESTAMP value is stored with a time zone name, interval
227 computations should adjust based on the time zone rules.
229 o Fix SELECT '0.01 years'::interval, '0.01 months'::interval
230 o Add a GUC variable to allow output of interval values in ISO8601
232 o Improve timestamptz subtraction to be DST-aware
234 Currently, subtracting one date from another that crosses a
235 daylight savings time adjustment can return '1 day 1 hour', but
236 adding that back to the first date returns a time one hour in
237 the future. This is caused by the adjustment of '25 hours' to
238 '1 day 1 hour', and '1 day' is the same time the next day, even
239 if daylight savings adjustments are involved.
241 o Fix interval display to support values exceeding 2^31 hours
242 o Add overflow checking to timestamp and interval arithmetic
243 o Add ISO INTERVAL handling
244 o -Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO
246 o Support ISO INTERVAL syntax if units cannot be determined from
247 the string, and are supplied after the string
249 The SQL standard states that the units after the string
250 specify the units of the string, e.g. INTERVAL '2' MINUTE
251 should return '00:02:00'. The current behavior has the units
252 restrict the interval value to the specified unit or unit
253 range, INTERVAL '70' SECOND returns '00:00:10'.
255 For syntax that isn't uniquely ISO or PG syntax, like '1' or
256 '1:30', treat as ISO if there is a range specification clause,
257 and as PG if there no clause is present, e.g. interpret '1:30'
258 MINUTE TO SECOND as '1 minute 30 seconds', and interpret
259 '1:30' as '1 hour, 30 minutes'.
261 This makes common cases like SELECT INTERVAL '1' MONTH
262 SQL-standard results. The SQL standard supports a limited
263 number of unit combinations and doesn't support unit names in
264 the string. The PostgreSQL syntax is more flexible in the
265 range of units supported, e.g. PostgreSQL supports '1 year 1
266 hour', while the SQL standard does not.
268 o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
269 o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
270 INTERVAL MONTH), and this should return '12 months'
271 o Round or truncate values to the requested precision, e.g.
272 INTERVAL '11 months' AS YEAR should return one or zero
273 o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
278 o -Allow NULLs in arrays
279 o Delay resolution of array expression's data type so assignment
280 coercion can be performed on empty array expressions
285 o Improve vacuum of large objects, like /contrib/vacuumlo?
286 o Add security checking for large objects
287 o Auto-delete large objects when referencing row is deleted
289 /contrib/lo offers this functionality.
291 o Allow read/write into TOAST values like large objects
293 This requires the TOAST column to be stored EXTERNAL.
299 * Allow INET subnet tests using non-constants to be indexed
300 * -Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
303 Current CURRENT_TIMESTAMP returns the start time of the current
304 transaction, and gettimeofday() returns the wallclock time. This will
305 make time reporting more consistent and will allow reporting of
306 the statement start time.
308 * %Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),
309 pg_get_tabledef(), pg_get_domaindef(), pg_get_functiondef()
310 * -Allow to_char() to print localized month names
311 * Allow to_date() and to_timestamp() accept localized month names
312 * Add missing parameter handling in to_char()
314 http://archives.postgresql.org/pgsql-hackers/2005-12/msg00948.php
316 * Allow functions to have a schema search path specified at creation time
317 * Allow substring/replace() to get/set bit values
318 * Allow to_char() on interval values to accumulate the highest unit
321 Some special format flag would be required to request such
322 accumulation. Such functionality could also be added to EXTRACT.
323 Prevent accumulation that crosses the month/day boundary because of
324 the uneven number of days in a month.
326 o to_char(INTERVAL '1 hour 5 minutes', 'MI') => 65
327 o to_char(INTERVAL '43 hours 20 minutes', 'MI' ) => 2600
328 o to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') => 0:1:19:20
329 o to_char(INTERVAL '3 years 5 months','MM') => 41
331 * -Add sleep() function, remove from regress.c
332 * -Allow user-defined functions retuning a domain value to enforce domain
334 * Add SPI_gettypmod() to return the typemod for a TupleDesc
337 Multi-Language Support
338 ======================
340 * Add NCHAR (as distinguished from ordinary varchar),
341 * Allow locale to be set at database creation
343 Currently locale can only be set during initdb. No global tables have
344 locale-aware columns. However, the database template used during
345 database creation might have locale-aware indexes. The indexes would
346 need to be reindexed to match the new locale.
348 * Allow encoding on a per-column basis
350 Right now only one encoding is allowed per database.
352 * Support multiple simultaneous character sets, per SQL92
353 * Improve UTF8 combined character handling?
354 * Add octet_length_server() and octet_length_client()
355 * Make octet_length_client() the same as octet_length()?
356 * Fix problems with wrong runtime encoding conversion for NLS message files
362 * Automatically create rules on views so they are updateable, per SQL99
364 We can only auto-create rules for simple views. For more complex
365 cases users will still have to write rules manually.
367 * Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
368 * Allow NOTIFY in rules involving conditionals
369 * Allow VIEW/RULE recompilation when the underlying tables change
371 Another issue is whether underlying table changes should be reflected
372 in the view, e.g. should SELECT * show additional columns if they
373 are added after the view is created.
379 * Change LIMIT/OFFSET and FETCH/MOVE to use int8
380 * Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
381 * Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
382 * %Allow SET CONSTRAINTS to be qualified by schema/table name
383 * -Allow TRUNCATE ... CASCADE/RESTRICT
385 This is like DELETE CASCADE, but truncates.
387 * %Add a separate TRUNCATE permission
389 Currently only the owner can TRUNCATE a table because triggers are not
390 called, and the table is locked in exclusive mode.
392 * Allow PREPARE of cursors
393 * -Allow PREPARE to automatically determine parameter types based on the SQL
395 * Allow finer control over the caching of prepared query plans
397 Currently, queries prepared via the libpq API are planned on first
398 execute using the supplied parameters --- allow SQL PREPARE to do the
399 same. Also, allow control over replanning prepared queries either
400 manually or automatically when statistics for execute parameters
401 differ dramatically from those used during planning.
403 * Invalidate prepared queries, like INSERT, when the table definition
405 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
407 Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
408 such information in memory would improve performance.
410 * Add optional textual message to NOTIFY
412 This would allow an informational message to be added to the notify
413 message, perhaps indicating the row modified or other custom
416 * Add a GUC variable to warn about non-standard SQL usage in queries
417 * Add SQL-standard MERGE command, typically used to merge two tables
420 This is similar to UPDATE, then for unmatched rows, INSERT.
421 Whether concurrent access allows modifications which could cause
422 row loss is implementation independent.
424 * Add REPLACE or UPSERT command that does UPDATE, or on failure, INSERT
427 To implement this cleanly requires that the table have a unique index
428 so duplicate checking can be easily performed. It is possible to
429 do it without a unique index if we require the user to LOCK the table
432 * Add NOVICE output level for helpful messages like automatic sequence/index
434 * -Add COMMENT ON for all cluster global objects (roles, databases
436 * -Make row-wise comparisons work per SQL spec
438 Right now, '(a, b) < (1, 2)' is processed as 'a < 1 and b < 2', but
439 the SQL standard requires it to be processed as a column-by-column
440 comparison, so the proper comparison is '(a < 1) OR (a = 1 AND b < 2)'.
442 * Add RESET CONNECTION command to reset all session state
444 This would include resetting of all variables (RESET ALL), dropping of
445 temporary tables, removing any NOTIFYs, cursors, open transactions,
446 prepared queries, currval()s, etc. This could be used for connection
447 pooling. We could also change RESET ALL to have this functionality.
448 The difficult of this features is allowing RESET ALL to not affect
449 changes made by the interface driver for its internal use. One idea
450 is for this to be a protocol-only feature. Another approach is to
451 notify the protocol when a RESET CONNECTION command is used.
453 * Add GUC to issue notice about statements that use unjoined tables
454 * Allow EXPLAIN to identify tables that were skipped because of
456 * Allow EXPLAIN output to be more easily processed by scripts
457 * -Enable escape_string_warning and standard_conforming_strings
458 * Make standard_conforming_strings the default in 8.3?
460 When this is done, backslash-quote should be prohibited in non-E''
461 strings because of possible confusion over how such strings treat
462 backslashes. Basically, '' is always safe for a literal single
463 quote, while \' might or might not be based on the backslash
466 * Simplify dropping roles that have objects in several databases
467 * Allow COMMENT ON to accept an expression rather than just a string
468 * Allow the count returned by SELECT, etc to be to represent as an int64
469 to allow a higher range of values
470 * Make CLUSTER preserve recently-dead tuples per MVCC requirements
471 * Add SQL99 WITH clause to SELECT
472 * Add SQL99 WITH RECURSIVE to SELECT
477 o Allow CREATE TABLE AS to determine column lengths for complex
478 expressions like SELECT col1 || col2
479 o Use more reliable method for CREATE DATABASE to get a consistent
481 o -Add ON COMMIT capability to CREATE TABLE AS ... SELECT
485 o Allow UPDATE to handle complex aggregates [update]?
486 o -Allow an alias to be provided for the target table in
488 o Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple
494 o %Have ALTER TABLE RENAME rename SERIAL sequence names
495 o Add ALTER DOMAIN to modify the underlying data type
496 o %Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
497 o %Allow ALTER TABLE to change constraint deferrability and actions
498 o Add missing object types for ALTER ... SET SCHEMA
499 o Allow ALTER TABLESPACE to move to different directories
500 o Allow databases to be moved to different tablespaces
501 o Allow moving system tables to other tablespaces, where possible
503 Currently non-global system tables must be in the default database
504 tablespace. Global system tables can never be moved.
506 o Prevent parent tables from altering or dropping constraints
507 like CHECK that are inherited by child tables unless CASCADE
509 o %Prevent child tables from altering or dropping constraints
510 like CHECK that were inherited from the parent table
511 o Have ALTER INDEX update the name of a constraint using that index
512 o Add ALTER TABLE RENAME CONSTRAINT, update index name also
517 o Automatically maintain clustering on a table
519 This might require some background daemon to maintain clustering
520 during periods of low usage. It might also require tables to be only
521 partially filled for easier reorganization. Another idea would
522 be to create a merged heap/index data file so an index lookup would
523 automatically access the heap data too. A third idea would be to
524 store heap rows in hashed groups, perhaps using a user-supplied
527 o %Add default clustering to system tables
529 To do this, determine the ideal cluster index for each system
530 table and set the cluster setting during initdb.
535 o Allow COPY to report error lines and continue
537 This requires the use of a savepoint before each COPY line is
538 processed, with ROLLBACK on COPY failure.
540 o -Have COPY return the number of rows loaded/unloaded?
541 o Allow COPY on a newly-created table to skip WAL logging
543 On crash recovery, the table involved in the COPY would
544 be removed or have its heap and index files truncated. One
545 issue is that no other backend should be able to add to
546 the table at the same time, which is something that is
549 o Allow COPY to output from views
551 Another idea would be to allow actual SELECT statements in a COPY.
556 o Allow column-level privileges
557 o %Allow GRANT/REVOKE permissions to be applied to all schema objects
560 The proposed syntax is:
561 GRANT SELECT ON ALL TABLES IN public TO phpuser;
562 GRANT SELECT ON NEW TABLES IN public TO phpuser;
564 * Allow GRANT/REVOKE permissions to be inherited by objects based on
567 * Allow SERIAL sequences to inherit permissions from the base table?
572 o Allow UPDATE/DELETE WHERE CURRENT OF cursor
574 This requires using the row ctid to map cursor rows back to the
575 original heap row. This become more complicated if WITH HOLD cursors
576 are to be supported because WITH HOLD cursors have a copy of the row
577 and no FOR UPDATE lock.
579 o Prevent DROP TABLE from dropping a row referenced by its own open
582 o -Allow pooled connections to list all open WITH HOLD cursors
584 Because WITH HOLD cursors exist outside transactions, this allows
585 them to be listed so they can be closed.
590 o Allow INSERT/UPDATE of the system-generated oid value for a row
591 o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
592 o Allow INSERT/UPDATE ... RETURNING new.col or old.col
594 This is useful for returning the auto-generated key for an INSERT.
595 One complication is how to handle rules that run as part of
601 o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
603 o Add SET PATH for schemas?
605 This is basically the same as SET search_path.
608 * Server-Side Languages
610 o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
611 o Allow function parameters to be passed by name,
612 get_employee_salary(emp_id => 12345, tax_year => 2001)
613 o Add Oracle-style packages
614 o Add table function support to pltcl, plpython
615 o Add capability to create and call PROCEDURES
616 o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
617 o Allow function argument names to be statements from PL/PgSQL
618 o Add MOVE to PL/pgSQL
619 o Add support for polymorphic arguments and return types to
620 languages other than PL/PgSQL
621 o Add support for OUT and INOUT parameters to languages other
623 o Add single-step debugging of PL/PgSQL functions
624 o Allow PL/PgSQL to support WITH HOLD cursors
630 * -Have initdb set the input DateStyle (MDY or DMY) based on locale
631 * Have pg_ctl look at PGHOST in case it is a socket directory?
632 * Allow pg_ctl to work properly with configuration files located outside
635 pg_ctl can not read the pid file because it isn't located in the
636 config directory but in the PGDATA directory. The solution is to
637 allow pg_ctl to read and understand postgresql.conf to find the
638 data_directory value.
643 o Have psql show current values for a sequence
644 o Move psql backslash database information into the backend, use
645 mnemonic commands? [psql]
647 This would allow non-psql clients to pull the same information out
648 of the database as psql.
650 o Fix psql's \d commands more consistent
652 http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php
653 http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php
655 o Allow psql \pset boolean variables to set to fixed values, rather
657 o Consistently display privilege information for all objects in psql
658 o -Improve psql's handling of multi-line statements
660 Currently, while \e saves a single statement as one entry, interactive
661 statements are saved one line at a time. Ideally all statements
662 would be saved like \e does.
664 o -Allow multi-line column values to align in the proper columns
666 If the second output column value is 'a\nb', the 'b' should appear
667 in the second display column, rather than the first column as it
670 o Display IN, INOUT, and OUT parameters in \df+
672 It probably requires psql to output newlines in the proper
673 column, which is already on the TODO list.
675 o Add auto-expanded mode so expanded output is used if the row
676 length is wider than the screen width.
678 Consider using auto-expanded mode for backslash commands like \df+.
680 o Prevent tab completion of SET TRANSACTION from querying the
681 database and therefore preventing the transaction isolation
682 level from being set.
684 Currently, SET <tab> causes a database lookup to check all
685 supported session variables. This query causes problems
686 because setting the transaction isolation level must be the
687 first statement of a transaction.
692 o %Allow pg_dump to use multiple -t and -n switches [pg_dump]
693 o %Add dumping of comments on index columns and composite type columns
694 o %Add full object name to the tag field. eg. for operators we need
695 '=(integer, integer)', instead of just '='.
696 o Add pg_dumpall custom format dumps?
697 o %Add CSV output format
698 o -Update pg_dump and psql to use the new COPY libpq API (Christopher)
699 o Remove unnecessary function pointer abstractions in pg_dump source
701 o Allow selection of individual object(s) of all types, not just
703 o In a selective dump, allow dumping of an object and all its
705 o Add options like pg_restore -l and -L to pg_dump
706 o Stop dumping CASCADE on DROP TYPE commands in clean mode
707 o Allow pg_dump --clean to drop roles that own objects or have
709 o Add -f to pg_dumpall
716 Document differences between ecpg and the SQL standard and
717 information about the Informix-compatibility module.
719 o Solve cardinality > 1 for input descriptors / variables?
720 o Add a semantic check level, e.g. check if a table really exists
721 o fix handling of DB attributes that are arrays
722 o Use backend PREPARE/EXECUTE facility for ecpg where possible
724 o Fix nested C comments
725 o %sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
726 o Make SET CONNECTION thread-aware, non-standard?
727 o Allow multidimensional arrays
728 o Add internationalized message strings
729 o Add COPY TO STDIN / STDOUT handling
734 o Add a function to support Parse/DescribeStatement capability
735 o Add PQescapeIdentifier()
736 o Prevent PQfnumber() from lowercasing unquoted the column name
738 PQfnumber() should never have been doing lowercasing, but
739 historically it has so we need a way to prevent it
741 o Allow statement results to be automatically batched to the client
743 Currently, all statement results are transferred to the libpq
744 client before libpq makes the results available to the
745 application. This feature would allow the application to make
746 use of the first result rows while the rest are transferred, or
747 held on the server waiting for them to be requested by libpq.
748 One complexity is that a statement like SELECT 1/col could error
749 out mid-way through the result set.
751 o Add new version of PQescapeString() that doesn't double backslashes
752 that are part of a client-only multibyte sequence
754 Single-quote is not a valid byte in any supported client-only
755 encoding. This requires using mblen() to determine if the
756 backslash is inside or outside a multi-byte sequence.
758 o Add new version of PQescapeString() that doesn't double
759 backslashes when standard_conforming_strings is true and
760 non-E strings are used
763 Referential Integrity
764 =====================
766 * Add MATCH PARTIAL referential integrity
767 * Add deferred trigger queue file
769 Right now all deferred trigger information is stored in backend
770 memory. This could exhaust memory for very large trigger queues.
771 This item involves dumping large queues into files.
773 * Change foreign key constraint for array -> element to mean element
775 * Allow DEFERRABLE UNIQUE constraints?
776 * Allow triggers to be disabled in only the current session.
778 This is currently possible by starting a multi-statement transaction,
779 modifying the system tables, performing the desired SQL, restoring the
780 system tables, and committing the transaction. ALTER TABLE ...
781 TRIGGER requires a table lock so it is not ideal for this usage.
783 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
785 If the dump is known to be valid, allow foreign keys to be added
786 without revalidating the data.
788 * Allow statement-level triggers to access modified rows
789 * Support triggers on columns (Greg Sabino Mullane)
790 * Enforce referential integrity for system tables
791 * Allow AFTER triggers on system tables
793 System tables are modified in many places in the backend without going
794 through the executor and therefore not causing triggers to fire. To
795 complete this item, the functions that modify system tables will have
802 * Flush cached query plans when the dependent objects change,
803 when the cardinality of parameters changes dramatically, or
804 when new ANALYZE statistics are available
806 A more complex solution would be to save multiple plans for different
807 cardinality and use the appropriate plan based on the EXECUTE values.
809 * Track dependencies in function bodies and recompile/invalidate
811 This is particularly important for references to temporary tables
812 in PL/PgSQL because PL/PgSQL caches query plans. The only workaround
813 in PL/PgSQL is to use EXECUTE. One complexity is that a function
814 might itself drop and recreate dependent tables, causing it to
815 invalidate its own query plan.
821 * Add pre-parsing phase that converts non-ISO syntax to supported
824 This could allow SQL written for other databases to run without
827 * Allow plug-in modules to emulate features from other databases
828 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
830 * Allow statements across databases or servers with transaction
833 This can be done using dblink and two-phase commit.
835 * Add the features of packages
837 o Make private objects accessible only to objects in the same schema
838 o Allow current_schema.objname to access current schema objects
839 o Add session variables
840 o Allow nested schemas
846 * Allow inherited tables to inherit index, UNIQUE constraint, and primary
848 * UNIQUE INDEX on base column not honored on INSERTs/UPDATEs from
849 inherited table: INSERT INTO inherit_table (unique_index_col) VALUES
852 The main difficulty with this item is the problem of creating an index
853 that can span more than one table.
855 * Allow SELECT ... FOR UPDATE on inherited tables
856 * Add UNIQUE capability to non-btree indexes
857 * Prevent index uniqueness checks when UPDATE does not modify the column
859 Uniqueness (index) checks are done when updating a column even if the
860 column is not modified by the UPDATE.
862 * Allow the creation of on-disk bitmap indexes which can be quickly
863 combined with other bitmap indexes
865 Such indexes could be more compact if there are only a few distinct values.
866 Such indexes can also be compressed. Keeping such indexes updated can be
869 * Allow use of indexes to search for NULLs
871 One solution is to create a partial index on an IS NULL expression.
873 * Allow accurate statistics to be collected on indexes with more than
874 one column or expression indexes, perhaps using per-index statistics
875 * Add fillfactor to control reserved free space during index creation
876 * Allow the creation of indexes with mixed ascending/descending
879 This is possible now by creating an operator class with reversed sort
880 operators. One complexity is that NULLs would then appear at the start
881 of the result set, and this might affect certain sort types, like
884 * Allow constraint_exclusion to work for UNIONs like it does for
885 inheritance, allow it to work for UPDATE and DELETE statements, and allow
886 it to be used for all statements with little performance impact
887 * Allow CREATE INDEX to take an additional parameter for use with
889 * Consider compressing indexes by storing key values duplicated in
890 several rows as a single index entry
892 This is difficult because it requires datatype-specific knowledge.
897 o Add more GIST index support for geometric data types
898 o Allow GIST indexes to create certain complex index types, like
899 digital trees (see Aoki)
903 o Pack hash index buckets onto disk pages more efficiently
905 Currently only one hash bucket can be stored on a page. Ideally
906 several hash buckets could be stored on a single page and greater
907 granularity used for the hash algorithm.
909 o Consider sorting hash buckets so entries can be found using a
910 binary search, rather than a linear scan
912 o In hash indexes, consider storing the hash value with or instead
915 o Add WAL logging for crash recovery
916 o Allow multi-column hash indexes
922 * Improve commit_delay handling to reduce fsync()
923 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
925 Ideally this requires a separate test program that can be run
926 at initdb time or optionally later. Consider O_SYNC when
929 * %Add an option to sync() before fsync()'ing checkpoint files
930 * Add program to test if fsync has a delay compared to non-fsync
936 * Allow free-behind capability for large sequential scans, perhaps using
939 Posix_fadvise() can control both sequential/random file caching and
940 free-behind behavior, but it is unclear how the setting affects other
941 backends that also have the file open, and the feature is not supported
942 on all operating systems.
946 We could use a fixed row count and a +/- count to follow MVCC
947 visibility rules, or a single cached value could be used and
948 invalidated if anyone modifies the table. Another idea is to
949 get a count directly from a unique index, but for this to be
950 faster than a sequential scan it must avoid access to the heap
951 to obtain tuple visibility information.
953 * Add estimated_count(*) to return an estimate of COUNT(*)
955 This would use the planner ANALYZE statistics to return an estimated
958 * Allow data to be pulled directly from indexes
960 Currently indexes do not have enough tuple visibility information
961 to allow data to be pulled from the index without also accessing
962 the heap. One way to allow this is to set a bit on index tuples
963 to indicate if a tuple is currently visible to all transactions
964 when the first valid heap lookup happens. This bit would have to
965 be cleared when a heap tuple is expired.
967 Another idea is to maintain a bitmap of heap pages where all rows
968 are visible to all backends, and allow index lookups to reference
969 that bitmap to avoid heap lookups, perhaps the same bitmap we might
970 add someday to determine which heap pages need vacuuming. Frequently
971 accessed bitmaps would have to be stored in shared memory. One 8k
972 page of bitmaps could track 512MB of heap pages.
974 * Consider automatic caching of statements at various levels:
980 * Allow sequential scans to take advantage of other concurrent
981 sequential scans, also called "Synchronised Scanning"
983 One possible implementation is to start sequential scans from the lowest
984 numbered buffer in the shared cache, and when reaching the end wrap
985 around to the beginning, rather than always starting sequential scans
986 at the start of the table.
992 * Improve speed with indexes
994 For large table adjustments during VACUUM FULL, it is faster to
995 reindex rather than update the index.
997 * Reduce lock time during VACUUM FULL by moving tuples with read lock,
998 then write lock and truncate table
1000 Moved tuples are invisible to other backends so they don't require a
1001 write lock. However, the read lock promotion to write lock could lead
1002 to deadlock situations.
1004 * Auto-fill the free space map by scanning the buffer cache or by
1005 checking pages written by the background writer
1006 * Create a bitmap of pages that need vacuuming
1008 Instead of sequentially scanning the entire table, have the background
1009 writer or some other process record pages that have expired rows, then
1010 VACUUM can look at just those pages rather than the entire table. In
1011 the event of a system crash, the bitmap would probably be invalidated.
1012 One complexity is that index entries still have to be vacuumed, and
1013 doing this without an index scan (by using the heap values to find the
1014 index entry) might be slow and unreliable, especially for user-defined
1017 * -Add system view to show free space map contents
1018 * Allow FSM to return free space toward the beginning of the heap file,
1019 in hopes that empty pages at the end can be truncated by VACUUM
1020 * Allow FSM page return free space based on table clustering, to assist
1021 in maintaining clustering?
1026 o Use free-space map information to guide refilling
1027 o %Issue log message to suggest VACUUM FULL if a table is nearly
1029 o Improve xid wraparound detection by recording per-table rather
1031 o Consider logging activity either to the logs or a system view
1037 * Fix priority ordering of read and write light-weight locks (Neil)
1040 Startup Time Improvements
1041 =========================
1043 * Experiment with multi-threaded backend for backend creation [thread]
1045 This would prevent the overhead associated with process creation. Most
1046 operating systems have trivial process creation time compared to
1047 database startup overhead, but a few operating systems (Win32,
1048 Solaris) might benefit from threading. Also explore the idea of
1049 a single session using multiple threads to execute a statement faster.
1051 * Experiment with multi-threaded backend better resource utilization
1053 This would allow a single query to make use of multiple CPU's or
1054 multiple I/O channels simultaneously. One idea is to create a
1055 background reader that can pre-fetch sequential and index scan
1056 pages needed by other backends. This could be expanded to allow
1057 concurrent reads from multiple devices in a partitioned table.
1059 * Add connection pooling
1061 It is unclear if this should be done inside the backend code or done
1062 by something external like pgpool. The passing of file descriptors to
1063 existing backends is one of the difficulties with a backend approach.
1069 * Eliminate need to write full pages to WAL before page modification [wal]
1071 Currently, to protect against partial disk page writes, we write
1072 full page images to WAL before they are modified so we can correct any
1073 partial page writes during recovery. These pages can also be
1074 eliminated from point-in-time archive files.
1076 o When off, write CRC to WAL and check file system blocks
1079 If CRC check fails during recovery, remember the page in case
1080 a later CRC for that page properly matches.
1082 o Write full pages during file system write and not when
1083 the page is modified in the buffer cache
1085 This allows most full page writes to happen in the background
1086 writer. It might cause problems for applying WAL on recovery
1087 into a partially-written page, but later the full page will be
1090 * Allow WAL traffic to be streamed to another server for stand-by
1092 * Reduce WAL traffic so only modified values are written rather than
1094 * Allow the pg_xlog directory location to be specified during initdb
1095 with a symlink back to the /data location
1096 * -Allow WAL information to recover corrupted pg_controldata
1097 * Find a way to reduce rotational delay when repeatedly writing
1100 Currently fsync of WAL requires the disk platter to perform a full
1101 rotation to fsync again. One idea is to write the WAL to different
1102 offsets that might reduce the rotational delay.
1104 * Allow buffered WAL writes and fsync
1106 Instead of guaranteeing recovery of all committed transactions, this
1107 would provide improved performance by delaying WAL writes and fsync
1108 so an abrupt operating system restart might lose a few seconds of
1109 committed transactions but still be consistent. We could perhaps
1110 remove the 'fsync' parameter (which results in an an inconsistent
1111 database) in favor of this capability.
1113 * Allow WAL logging to be turned off for a table, but the table
1114 might be dropped or truncated during crash recovery [walcontrol]
1116 Allow tables to bypass WAL writes and just fsync() dirty pages on
1117 commit. This should be implemented using ALTER TABLE, e.g. ALTER
1118 TABLE PERSISTENCE [ DROP | TRUNCATE | DEFAULT ]. Tables using
1119 non-default logging should not use referential integrity with
1120 default-logging tables. A table without dirty buffers during a
1121 crash could perhaps avoid the drop/truncate.
1123 * Allow WAL logging to be turned off for a table, but the table would
1124 avoid being truncated/dropped [walcontrol]
1126 To do this, only a single writer can modify the table, and writes
1127 must happen only on new pages so the new pages can be removed during
1128 crash recovery. Readers can continue accessing the table. Such
1129 tables probably cannot have indexes. One complexity is the handling
1130 of indexes on TOAST tables.
1133 Optimizer / Executor
1134 ====================
1136 * Improve selectivity functions for geometric operators
1137 * Allow ORDER BY ... LIMIT # to select high/low value without sort or
1138 index using a sequential scan for highest/lowest values
1140 Right now, if no index exists, ORDER BY ... LIMIT # requires we sort
1141 all values to return the high/low value. Instead The idea is to do a
1142 sequential scan to find the high/low value, thus avoiding the sort.
1143 MIN/MAX already does this, but not for LIMIT > 1.
1145 * Precompile SQL functions to avoid overhead
1146 * Create utility to compute accurate random_page_cost value
1147 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
1148 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
1149 * Consider using hash buckets to do DISTINCT, rather than sorting
1151 This would be beneficial when there are few distinct values. This is
1152 already used by GROUP BY.
1154 * Log statements where the optimizer row estimates were dramatically
1155 different from the number of rows actually found?
1158 Miscellaneous Performance
1159 =========================
1161 * Do async I/O for faster random read-ahead of data
1163 Async I/O allows multiple I/O requests to be sent to the disk with
1164 results coming back asynchronously.
1166 * Use mmap() rather than SYSV shared memory or to write WAL files?
1168 This would remove the requirement for SYSV SHM but would introduce
1169 portability issues. Anonymous mmap (or mmap to /dev/zero) is required
1170 to prevent I/O overhead.
1172 * Consider mmap()'ing files into a backend?
1174 Doing I/O to large tables would consume a lot of address space or
1175 require frequent mapping/unmapping. Extending the file also causes
1176 mapping problems that might require mapping only individual pages,
1177 leading to thousands of mappings. Another problem is that there is no
1178 way to _prevent_ I/O to disk from the dirty shared buffers so changes
1179 could hit disk before WAL is written.
1181 * Add a script to ask system configuration questions and tune postgresql.conf
1182 * Merge xmin/xmax/cmin/cmax back into three header fields
1184 Before subtransactions, there used to be only three fields needed to
1185 store these four values. This was possible because only the current
1186 transaction looks at the cmin/cmax values. If the current transaction
1187 created and expired the row the fields stored where xmin (same as
1188 xmax), cmin, cmax, and if the transaction was expiring a row from a
1189 another transaction, the fields stored were xmin (cmin was not
1190 needed), xmax, and cmax. Such a system worked because a transaction
1191 could only see rows from another completed transaction. However,
1192 subtransactions can see rows from outer transactions, and once the
1193 subtransaction completes, the outer transaction continues, requiring
1194 the storage of all four fields. With subtransactions, an outer
1195 transaction can create a row, a subtransaction expire it, and when the
1196 subtransaction completes, the outer transaction still has to have
1197 proper visibility of the row's cmin, for example, for cursors.
1199 One possible solution is to create a phantom cid which represents a
1200 cmin/cmax pair and is stored in local memory. Another idea is to
1201 store both cmin and cmax only in local memory.
1203 * Research storing disk pages with no alignment/padding
1209 * Add use of 'const' for variables in source tree
1210 * Rename some /contrib modules from pg* to pg_*
1211 * Move some things from /contrib into main tree
1212 * Move some /contrib modules out to their own project sites
1213 * %Remove warnings created by -Wcast-align
1214 * Move platform-specific ps status display info from ps_status.c to ports
1215 * Add optional CRC checksum to heap and index pages
1216 * Improve documentation to build only interfaces (Marc)
1217 * Remove or relicense modules that are not under the BSD license, if possible
1218 * %Remove memory/file descriptor freeing before ereport(ERROR)
1219 * Acquire lock on a relation before building a relcache entry for it
1220 * %Promote debug_query_string into a server-side function current_query()
1221 * %Allow the identifier length to be increased via a configure option
1222 * Allow cross-compiling by generating the zic database on the target system
1223 * Improve NLS maintenance of libpgport messages linked onto applications
1224 * Allow ecpg to work with MSVC and BCC
1225 * Add xpath_array() to /contrib/xml2 to return results as an array
1226 * Allow building in directories containing spaces
1228 This is probably not possible because 'gmake' and other compiler tools
1229 do not fully support quoting of paths with spaces.
1231 * -Allow installing to directories containing spaces
1233 This is possible if proper quoting is added to the makefiles for the
1234 install targets. Because PostgreSQL supports relocatable installs, it
1235 is already possible to install into a directory that doesn't contain
1236 spaces and then copy the install to a directory with spaces.
1238 * Fix sgmltools so PDFs can be generated with bookmarks
1239 * -%Clean up compiler warnings (especially with gcc version 4)
1240 * Use UTF8 encoding for NLS messages so all server encodings can
1242 * Update Bonjour to work with newer cross-platform SDK
1243 * -Remove BeOS and QNX-specific code
1244 * Split out libpq pgpass and environment documentation sections to make
1245 it easier for non-developers to find
1246 * Improve port/qsort() to handle sorts with 50% unique and 50% duplicate
1249 This involves choosing better pivot points for the quicksort.
1254 o Remove configure.in check for link failure when cause is found
1255 o Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1257 o Remove psql newline patch when we find out why mingw outputs an
1259 o Allow psql to use readline once non-US code pages work with
1261 o Re-enable timezone output on log_line_prefix '%t' when a
1262 shorter timezone string is available
1263 o Fix problem with shared memory on the Win32 Terminal Server
1264 o Improve signal handling,
1265 http://archives.postgresql.org/pgsql-patches/2005-06/msg00027.php
1266 o Add long file support for binary pg_dump output
1268 While Win32 supports 64-bit files, the MinGW API does not,
1269 meaning we have to build an fseeko replacement on top of the
1270 Win32 API, and we have to make sure MinGW handles it. Another
1271 option is to wait for the MinGW project to fix it, or use the
1272 code from the LibGW32C project as a guide.
1275 o Check WSACancelBlockingCall() for interrupts (win32intr)
1278 * Wire Protocol Changes
1280 o Allow dynamic character set handling
1281 o Add decoded type, length, precision
1283 o Update clients to use data types, typmod, schema.table.column names
1284 of result sets using new statement protocol
1287 ---------------------------------------------------------------------------
1290 Developers who have claimed items are:
1291 --------------------------------------
1292 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
1293 * Andrew is Andrew Dunstan <andrew@dunslane.net>
1294 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
1295 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
1296 Family Health Network
1297 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
1298 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
1299 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
1300 * Greg is Greg Sabino Mullane <greg@turnstep.com>
1301 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
1302 * Joe is Joe Conway <mail@joeconway.com>
1303 * Karel is Karel Zak <zakkr@zf.jcu.cz>
1304 * Magnus is Magnus Hagander <mha@sollentuna.net>
1305 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
1306 * Matthew T. O'Connor <matthew@zeut.net>
1307 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
1308 * Neil is Neil Conway <neilc@samurai.com>
1309 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
1310 * Peter is Peter Eisentraut <peter_e@gmx.net>
1311 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
1312 * Rod is Rod Taylor <pg@rbt.ca>
1313 * Simon is Simon Riggs <simon@2ndquadrant.com>
1314 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
1315 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
1316 * Teodor is Teodor Sigaev <teodor@sigaev.ru>
1317 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat