]> granicus.if.org Git - postgresql/blob - doc/TODO
Add:
[postgresql] / doc / TODO
1
2 PostgreSQL TODO List
3 ====================
4 Current maintainer:     Bruce Momjian (pgman@candle.pha.pa.us)
5 Last updated:           Thu Sep 22 17:50:57 EDT 2005
6
7 The most recent version of this document can be viewed at
8 http://www.postgresql.org/docs/faqs.TODO.html.
9
10 #A hyphen, "-", marks changes that will appear in the upcoming 8.1 release.#
11 #A percent sign, "%", marks items that are easier to implement.#
12
13 Bracketed items, "[]", have more detail.
14
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
17 first.
18
19
20 Administration
21 ==============
22
23 * %Remove behavior of postmaster -o after making postmaster/postgres
24   flags unique
25 * %Allow pooled connections to list all prepared queries
26
27   This would allow an application inheriting a pooled connection to know
28   the queries prepared in the current session.
29
30 * Allow major upgrades without dump/reload, perhaps using pg_upgrade 
31   [pg_upgrade]
32 * Check for unreferenced table files created by transactions that were
33   in-progress when the server terminated abruptly
34 * Allow administrators to safely terminate individual sessions either
35   via an SQL function or SIGTERM 
36
37   Lock table corruption following SIGTERM of an individual backend
38   has been reported in 8.0.  A possible cause was fixed in 8.1, but
39   it is unknown whether other problems exist.  This item mostly
40   requires additional testing rather than of writing any new code.
41
42 * %Set proper permissions on non-system schemas during db creation
43
44   Currently all schemas are owned by the super-user because they are
45   copied from the template1 database.
46
47 * Support table partitioning that allows a single table to be stored
48   in subtables that are partitioned based on the primary key or a WHERE
49   clause
50
51
52 * Improve replication solutions
53
54         o Load balancing
55
56           You can use any of the master/slave replication servers to use a
57           standby server for data warehousing. To allow read/write queries to
58           multiple servers, you need multi-master replication like pgcluster.
59
60         o Allow replication over unreliable or non-persistent links
61
62
63 * Configuration files
64
65         o %Add "include file" functionality in postgresql.conf
66         o %Allow commenting of variables in postgresql.conf to restore them
67           to defaults
68
69           Currently, if a variable is commented out, it keeps the
70           previous uncommented value until a server restarted.
71
72         o %Allow pg_hba.conf settings to be controlled via SQL
73
74           This would add a function to load the SQL table from
75           pg_hba.conf, and one to writes its contents to the flat file.
76           The table should have a line number that is a float so rows
77           can be inserted between existing rows, e.g. row 2.5 goes
78           between row 2 and row 3.
79
80         o %Allow postgresql.conf file values to be changed via an SQL
81           API, perhaps using SET GLOBAL
82         o Allow the server to be stopped/restarted via an SQL API
83         o Issue a warning if a change-on-restart-only postgresql.conf value
84           is modified  and the server config files are reloaded
85         o Mark change-on-restart-only values in postgresql.conf
86
87
88 * Tablespaces
89
90         * Allow a database in tablespace t1 with tables created in
91           tablespace t2 to be used as a template for a new database created
92           with default tablespace t2
93
94           All objects in the default database tablespace must have default
95           tablespace specifications. This is because new databases are
96           created by copying directories. If you mix default tablespace
97           tables and tablespace-specified tables in the same directory,
98           creating a new database from such a mixed directory would create a
99           new database with tables that had incorrect explicit tablespaces.
100           To fix this would require modifying pg_class in the newly copied
101           database, which we don't currently do.
102
103         * Allow reporting of which objects are in which tablespaces
104
105           This item is difficult because a tablespace can contain objects
106           from multiple databases. There is a server-side function that
107           returns the databases which use a specific tablespace, so this
108           requires a tool that will call that function and connect to each
109           database to find the objects in each database for that tablespace.
110
111         o %Add a GUC variable to control the tablespace for temporary objects
112           and sort files
113
114           It could start with a random tablespace from a supplied list and
115           cycle through the list.
116
117         o Allow WAL replay of CREATE TABLESPACE to work when the directory
118           structure on the recovery computer is different from the original
119
120         o Allow per-tablespace quotas
121
122
123 * Point-In-Time Recovery (PITR)
124
125           o Allow point-in-time recovery to archive partially filled
126             write-ahead logs [pitr]
127
128             Currently only full WAL files are archived. This means that the
129             most recent transactions aren't available for recovery in case
130             of a disk failure. This could be triggered by a user command or
131             a timer.
132
133           o Automatically force archiving of partially-filled WAL files when
134             pg_stop_backup() is called or the server is stopped
135
136             Doing this will allow administrators to know more easily when
137             the archive contins all the files needed for point-in-time
138             recovery.
139
140           o %Create dump tool for write-ahead logs for use in determining
141             transaction id for point-in-time recovery
142           o Allow a warm standby system to also allow read-only queries
143             [pitr]
144
145             This is useful for checking PITR recovery.
146
147           o Allow the PITR process to be debugged and data examined
148
149
150 Monitoring
151 ==========
152
153 * Allow server log information to be output as INSERT statements
154
155   This would allow server log information to be easily loaded into
156   a database for analysis.
157
158 * %Add ability to monitor the use of temporary sort files
159 * Allow server logs to be remotely read and removed using SQL commands
160
161
162 Data Types
163 ==========
164
165 * Improve the MONEY data type
166
167   Change the MONEY data type to use DECIMAL internally, with special
168   locale-aware output formatting.
169
170 * Change NUMERIC to enforce the maximum precision, and increase it
171 * Add NUMERIC division operator that doesn't round?
172
173   Currently NUMERIC _rounds_ the result to the specified precision.  
174   This means division can return a result that multiplied by the 
175   divisor is greater than the dividend, e.g. this returns a value > 10:
176
177     SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
178
179   The positive modulus result returned by NUMERICs might be considered
180   inaccurate, in one sense.
181
182 * Have sequence dependency track use of DEFAULT sequences,
183   seqname.nextval?
184 * %Disallow changing default expression of a SERIAL column?
185 * Fix data types where equality comparison isn't intuitive, e.g. box
186 * %Prevent INET cast to CIDR if the unmasked bits are not zero, or
187   zero the bits
188 * %Prevent INET cast to CIDR from droping netmask, SELECT '1.1.1.1'::inet::cidr
189 * Allow INET + INT4 to increment the host part of the address, or
190   throw an error on overflow
191 * %Add 'tid != tid ' operator for use in corruption recovery
192 * Allow user-defined types to specify a type modifier at table creation
193   time
194
195
196 * Dates and Times
197
198         o Allow infinite dates just like infinite timestamps
199         o Add a GUC variable to allow output of interval values in ISO8601 
200           format
201         o Merge hardwired timezone names with the TZ database; allow either 
202           kind everywhere a TZ name is currently taken
203         o Allow customization of the known set of TZ names (generalize the
204           present australian_timezones hack)
205         o Allow TIMESTAMP WITH TIME ZONE to store the original timezone
206           information, either zone name or offset from UTC [timezone]
207
208           If the TIMESTAMP value is stored with a time zone name, interval 
209           computations should adjust based on the time zone rules.
210
211         o Fix SELECT '0.01 years'::interval, '0.01 months'::interval
212         o Fix SELECT INTERVAL '1' MONTH
213         o Add ISO INTERVAL handling
214                 o Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO 
215                   SECOND
216                 o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
217                 o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or
218                   '1', treat as ISO if there is a range specification clause,
219                   and as PG if there no clause is present, e.g. interpret 
220                           '1:30' MINUTE TO SECOND as '1 minute 30 seconds', and 
221                           interpret '1:30' as '1 hour, 30 minutes'
222                 o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
223                   INTERVAL MONTH), and this should return '12 months'
224                 o Round or truncate values to the requested precision, e.g.
225                   INTERVAL '11 months' AS YEAR should return one or zero
226                 o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
227
228
229 * Arrays
230
231         o Allow NULLs in arrays
232         o Delay resolution of array expression's data type so assignment
233           coercion can be performed on empty array expressions
234
235
236 * Binary Data
237
238         o Improve vacuum of large objects, like /contrib/vacuumlo?
239         o Add security checking for large objects
240         o Auto-delete large objects when referencing row is deleted
241
242           /contrib/lo offers this functionality.
243
244         o Allow read/write into TOAST values like large objects
245
246           This requires the TOAST column to be stored EXTERNAL.
247
248
249 Functions
250 =========
251
252 * Allow INET subnet tests using non-constants to be indexed
253 * Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
254   functionality
255
256   Current CURRENT_TIMESTAMP returns the start time of the current
257   transaction, and gettimeofday() returns the wallclock time. This will
258   make time reporting more consistent and will allow reporting of
259   the statement start time.
260
261 * %Add pg_get_acldef(), pg_get_typedefault(), and pg_get_attrdef()
262 * Allow to_char() to print localized month names
263 * Allow functions to have a schema search path specified at creation time
264 * Allow substring/replace() to get/set bit values
265 * Allow to_char() on interval values to accumulate the highest unit
266   requested
267
268   Some special format flag would be required to request such
269   accumulation.  Such functionality could also be added to EXTRACT. 
270   Prevent accumulation that crosses the month/day boundary because of
271   the uneven number of days in a month.
272
273         o to_char(INTERVAL '1 hour 5 minutes', 'MI') => 65
274         o to_char(INTERVAL '43 hours 20 minutes', 'MI' ) => 2600 
275         o to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') => 0:1:19:20
276         o to_char(INTERVAL '3 years 5 months','MM') => 41
277
278 * Add sleep() function, remove from regress.c
279
280
281 Multi-Language Support
282 ======================
283
284 * Add NCHAR (as distinguished from ordinary varchar),
285 * Allow locale to be set at database creation
286
287   Currently locale can only be set during initdb.  No global tables have
288   locale-aware columns.  However, the database template used during
289   database creation might have locale-aware indexes.  The indexes would
290   need to be reindexed to match the new locale.
291
292 * Allow encoding on a per-column basis
293
294   Right now only one encoding is allowed per database.
295
296 * Support multiple simultaneous character sets, per SQL92
297 * Improve UTF8 combined character handling?
298 * Add octet_length_server() and octet_length_client()
299 * Make octet_length_client() the same as octet_length()?
300 * Fix problems with wrong runtime encoding conversion for NLS message files
301
302
303 Views / Rules
304 =============
305
306 * %Automatically create rules on views so they are updateable, per SQL99
307
308   We can only auto-create rules for simple views.  For more complex
309   cases users will still have to write rules.
310
311 * Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
312 * Allow NOTIFY in rules involving conditionals
313 * Allow VIEW/RULE recompilation when the underlying tables change
314
315   Another issue is whether underlying table changes should be reflected
316   in the view, e.g. should SELECT * show additional columns if they
317   are added after the view is created.
318
319
320 SQL Commands
321 ============
322
323 * Change LIMIT/OFFSET and FETCH/MOVE to use int8
324 * Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
325 * Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
326 * %Allow SET CONSTRAINTS to be qualified by schema/table name
327 * %Allow TRUNCATE ... CASCADE/RESTRICT
328
329   This is like DELETE CASCADE, but truncates.
330
331 * %Add a separate TRUNCATE permission
332
333   Currently only the owner can TRUNCATE a table because triggers are not
334   called, and the table is locked in exclusive mode.
335
336 * Allow PREPARE of cursors
337 * Allow PREPARE to automatically determine parameter types based on the SQL
338   statement
339 * Allow finer control over the caching of prepared query plans
340
341   Currently, queries prepared via the libpq API are planned on first
342   execute using the supplied parameters --- allow SQL PREPARE to do the
343   same.  Also, allow control over replanning prepared queries either
344   manually or automatically when statistics for execute parameters
345   differ dramatically from those used during planning.
346
347 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
348
349   Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
350   such information in memory would improve performance.
351
352 * Add optional textual message to NOTIFY
353
354   This would allow an informational message to be added to the notify
355   message, perhaps indicating the row modified or other custom
356   information.
357
358 * Add a GUC variable to warn about non-standard SQL usage in queries
359 * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules,
360   triggers?)
361 * Add NOVICE output level for helpful messages like automatic sequence/index
362   creation
363 * %Add COMMENT ON for all cluster global objects (roles, databases
364   and tablespaces)
365 * %Make row-wise comparisons work per SQL spec
366 * Add RESET CONNECTION command to reset all session state
367
368   This would include resetting of all variables (RESET ALL), dropping of
369   temporary tables, removing any NOTIFYs, cursors, open transactions,
370   prepared queries, currval()s, etc.  This could be used  for connection
371   pooling.  We could also change RESET ALL to have this functionality.  
372   The difficult of this features is allowing RESET ALL to not affect 
373   changes made by the interface driver for its internal use.  One idea 
374   is for this to be a protocol-only feature.  Another approach is to 
375   notify the protocol when a RESET CONNECTION command is used.
376
377 * Add GUC to issue notice about queries that use unjoined tables
378 * Allow EXPLAIN to identify tables that were skipped because of 
379   constraint_exclusion
380 * Allow EXPLAIN output to be more easily processed by scripts
381 * Eventually enable escape_string_warning and standard_conforming_strings
382
383
384 * CREATE
385
386         o Allow CREATE TABLE AS to determine column lengths for complex
387           expressions like SELECT col1 || col2
388         o Use more reliable method for CREATE DATABASE to get a consistent
389           copy of db?
390         o Add ON COMMIT capability to CREATE TABLE AS ... SELECT
391
392
393 * UPDATE
394         o Allow UPDATE to handle complex aggregates [update]?
395         o Allow an alias to be provided for the target table in
396           UPDATE/DELETE
397
398           This is not SQL-spec but many DBMSs allow it.
399
400         o Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple
401           columns
402
403
404 * ALTER
405
406         o %Have ALTER TABLE RENAME rename SERIAL sequence names
407         o Add ALTER DOMAIN to modify the underlying data type
408         o %Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
409         o %Allow ALTER TABLE to change constraint deferrability and actions
410         o Add missing object types for ALTER ... SET SCHEMA
411         o Allow ALTER TABLESPACE to move to different directories
412         o Allow databases to be moved to different tablespaces
413         o Allow moving system tables to other tablespaces, where possible
414
415           Currently non-global system tables must be in the default database
416           tablespace. Global system tables can never be moved.
417
418         o %Disallow dropping of an inherited constraint
419         o %Prevent child tables from altering or dropping constraints 
420           like CHECK that were inherited from the parent table
421
422
423 * CLUSTER
424
425         o Automatically maintain clustering on a table
426
427           This might require some background daemon to maintain clustering
428           during periods of low usage. It might also require tables to be only
429           paritally filled for easier reorganization.  Another idea would
430           be to create a merged heap/index data file so an index lookup would
431           automatically access the heap data too.  A third idea would be to
432           store heap rows in hashed groups, perhaps using a user-supplied
433           hash function.
434
435         o %Add default clustering to system tables
436
437           To do this, determine the ideal cluster index for each system
438           table and set the cluster setting during initdb.
439
440
441 * COPY
442
443         o Allow COPY to report error lines and continue
444
445           This requires the use of a savepoint before each COPY line is
446           processed, with ROLLBACK on COPY failure.
447
448         o %Have COPY return the number of rows loaded/unloaded?
449         o Allow COPY on a newly-created table to skip WAL logging
450
451           On crash recovery, the table involved in the COPY would
452           be removed or have its heap and index files truncated.  One
453           issue is that no other backend should be able to add to 
454           the table at the same time, which is something that is 
455           currently allowed.
456
457         o Allow COPY to output from views
458
459           Another idea would be to allow actual SELECT queries in a COPY.
460
461
462 * GRANT/REVOKE
463
464         o Allow column-level privileges
465         o %Allow GRANT/REVOKE permissions to be applied to all schema objects
466           with one command
467
468           The proposed syntax is:
469                 GRANT SELECT ON ALL TABLES IN public TO phpuser;
470                 GRANT SELECT ON NEW TABLES IN public TO phpuser;
471
472         * Allow GRANT/REVOKE permissions to be inherited by objects based on
473           schema permissions
474
475
476 * CURSOR
477
478         o Allow UPDATE/DELETE WHERE CURRENT OF cursor
479
480           This requires using the row ctid to map cursor rows back to the
481           original heap row. This become more complicated if WITH HOLD cursors
482           are to be supported because WITH HOLD cursors have a copy of the row
483           and no FOR UPDATE lock.
484
485         o Prevent DROP TABLE from dropping a row referenced by its own open
486           cursor?
487
488         o %Allow pooled connections to list all open WITH HOLD cursors
489
490           Because WITH HOLD cursors exist outside transactions, this allows
491           them to be listed so they can be closed.
492
493
494 * INSERT
495
496         o Allow INSERT/UPDATE of the system-generated oid value for a row
497         o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
498         o Allow INSERT/UPDATE ... RETURNING new.col or old.col
499
500           This is useful for returning the auto-generated key for an INSERT.
501           One complication is how to handle rules that run as part of
502           the insert.
503
504
505 * SHOW/SET
506
507         o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
508           ANALYZE, and CLUSTER
509         o Add SET PATH for schemas?
510
511           This is basically the same as SET search_path.
512
513
514 * Server-Side Languages
515
516         o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
517         o Allow function parameters to be passed by name,
518           get_employee_salary(emp_id => 12345, tax_year => 2001)
519         o Add Oracle-style packages
520         o Add table function support to pltcl, plpython
521         o Add capability to create and call PROCEDURES
522         o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
523         o Allow function argument names to be queries from PL/PgSQL
524         o Add MOVE to PL/pgSQL
525         o Add support for polymorphic arguments and return types to
526           languages other than PL/PgSQL
527         o Add support for OUT and INOUT parameters to languages other 
528           than PL/PgSQL
529         o Add single-step debugging of PL/PgSQL functions
530
531
532 Clients
533 =======
534
535 * Add a libpq function to support Parse/DescribeStatement capability
536 * Prevent libpq's PQfnumber() from lowercasing the column name?
537 * Add PQescapeIdentifier() to libpq
538 * Have initdb set the input DateStyle (MDY or DMY) based on locale?
539 * Have pg_ctl look at PGHOST in case it is a socket directory?
540 * Allow pg_ctl to work properly with configuration files located outside
541   the PGDATA directory
542
543   pg_ctl can not read the pid file because it isn't located in the
544   config directory but in the PGDATA directory.  The solution is to
545   allow pg_ctl to read and understand postgresql.conf to find the
546   data_directory value.
547
548
549 * psql
550
551         o Have psql show current values for a sequence
552         o Move psql backslash database information into the backend, use
553           mnemonic commands? [psql]
554
555           This would allow non-psql clients to pull the same information out
556           of the database as psql.
557
558         o Fix psql's display of schema information (Neil)
559         o Allow psql \pset boolean variables to set to fixed values, rather
560           than toggle
561         o Consistently display privilege information for all objects in psql
562         o Improve psql's handling of multi-line queries
563
564           Currently, while \e saves a single query as one entry, interactive
565           queries are saved one line at a time.  Ideally all queries
566           whould be saved like \e does.
567
568         o Allow multi-line column values to align in the proper columns
569
570           If the second output column value is 'a\nb', the 'b' should appear
571           in the second display column, rather than the first column as it
572           does now.
573
574
575 * pg_dump
576
577         o %Have pg_dump use multi-statement transactions for INSERT dumps
578         o %Allow pg_dump to use multiple -t and -n switches [pg_dump]
579         o %Add dumping of comments on composite type columns
580         o %Add dumping of comments on index columns
581         o %Replace crude DELETE FROM method of pg_dumpall --clean for 
582           cleaning of roles with separate DROP commands
583         o Stop dumping CASCADE on DROP TYPE commands in clean mode
584         o %Add full object name to the tag field.  eg. for operators we need
585           '=(integer, integer)', instead of just '='.
586         o Add pg_dumpall custom format dumps?
587         o %Add CSV output format
588         o Update pg_dump and psql to use the new COPY libpq API (Christopher)
589         o Remove unnecessary function pointer abstractions in pg_dump source
590           code
591
592
593 * ecpg
594
595         o Docs
596
597           Document differences between ecpg and the SQL standard and
598           information about the Informix-compatibility module.
599
600         o Solve cardinality > 1 for input descriptors / variables?
601         o Add a semantic check level, e.g. check if a table really exists
602         o fix handling of DB attributes that are arrays
603         o Use backend PREPARE/EXECUTE facility for ecpg where possible
604         o Implement SQLDA
605         o Fix nested C comments
606         o %sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
607         o Make SET CONNECTION thread-aware, non-standard?
608         o Allow multidimensional arrays
609         o Add internationalized message strings
610
611
612 Referential Integrity
613 =====================
614
615 * Add MATCH PARTIAL referential integrity
616 * Add deferred trigger queue file
617
618   Right now all deferred trigger information is stored in backend
619   memory.  This could exhaust memory for very large trigger queues.
620   This item involves dumping large queues into files.
621
622 * Change foreign key constraint for array -> element to mean element
623   in array?
624 * Allow DEFERRABLE UNIQUE constraints?
625 * Allow triggers to be disabled in only the current session.
626
627   This is currently possible by starting a multi-statement transaction,
628   modifying the system tables, performing the desired SQL, restoring the
629   system tables, and committing the transaction.  ALTER TABLE ...
630   TRIGGER requires a table lock so it is not ideal for this usage.
631
632 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
633
634   If the dump is known to be valid, allow foreign keys to be added
635   without revalidating the data.
636
637 * Allow statement-level triggers to access modified rows
638 * Support triggers on columns (Greg Sabino Mullane)
639 * Enforce referential integrity for system tables
640 * Allow AFTER triggers on system tables
641
642   System tables are modified in many places in the backend without going
643   through the executor and therefore not causing triggers to fire. To
644   complete this item, the functions that modify system tables will have
645   to fire triggers.
646
647
648 Dependency Checking
649 ===================
650
651 * Flush cached query plans when the dependent objects change
652 * Track dependencies in function bodies and recompile/invalidate
653
654   This is particularly important for references to temporary tables
655   in PL/PgSQL because PL/PgSQL caches query plans.  The only workaround
656   in PL/PgSQL is to use EXECUTE.  One complexity is that a function
657   might itself drop and recreate dependent tables, causing it to
658   invalidate its own query plan.
659
660
661 Exotic Features
662 ===============
663
664 * Add SQL99 WITH clause to SELECT
665 * Add SQL99 WITH RECURSIVE to SELECT
666 * Add pre-parsing phase that converts non-ISO syntax to supported
667   syntax
668
669   This could allow SQL written for other databases to run without
670   modification.
671
672 * Allow plug-in modules to emulate features from other databases
673 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
674   to clients
675 * Allow queries across databases or servers with transaction
676   semantics
677
678   This can be done using dblink and two-phase commit.
679
680 * Add the features of packages
681
682         o  Make private objects accessable only to objects in the same schema
683         o  Allow current_schema.objname to access current schema objects
684         o  Add session variables
685         o  Allow nested schemas
686
687
688 Indexes
689 =======
690
691 * Allow inherited tables to inherit index, UNIQUE constraint, and primary
692   key, foreign key
693 * UNIQUE INDEX on base column not honored on INSERTs/UPDATEs from
694   inherited table:  INSERT INTO inherit_table (unique_index_col) VALUES
695   (dup) should fail
696
697   The main difficulty with this item is the problem of creating an index
698   that can span more than one table.
699
700 * Allow SELECT ... FOR UPDATE on inherited tables
701 * Add UNIQUE capability to non-btree indexes
702 * Prevent index uniqueness checks when UPDATE does not modify the column
703
704   Uniqueness (index) checks are done when updating a column even if the
705   column is not modified by the UPDATE.
706
707 * Allow the creation of on-disk bitmap indexes which can be quickly
708   combined with other bitmap indexes
709
710   Such indexes could be more compact if there are only a few distinct values.
711   Such indexes can also be compressed.  Keeping such indexes updated can be
712   costly.
713
714 * Allow use of indexes to search for NULLs
715
716   One solution is to create a partial index on an IS NULL expression.
717
718 * Allow accurate statistics to be collected on indexes with more than
719   one column or expression indexes, perhaps using per-index statistics
720 * Add fillfactor to control reserved free space during index creation
721 * Allow the creation of indexes with mixed ascending/descending specifiers
722 * Allow constraint_exclusion to work for UNIONs like it does for
723   inheritance, allow it to work for UPDATE and DELETE queries, and allow
724   it to be used for all queries with little performance impact
725
726
727 * GIST
728
729         o Add more GIST index support for geometric data types
730         o Allow GIST indexes to create certain complex index types, like
731           digital trees (see Aoki)
732
733 * Hash
734
735         o Pack hash index buckets onto disk pages more efficiently
736
737           Currently only one hash bucket can be stored on a page. Ideally
738           several hash buckets could be stored on a single page and greater
739           granularity used for the hash algorithm.
740
741         o Consider sorting hash buckets so entries can be found using a
742           binary search, rather than a linear scan
743
744         o In hash indexes, consider storing the hash value with or instead
745           of the key itself
746
747         o Add WAL logging for crash recovery
748         o Allow multi-column hash indexes
749
750
751 Fsync
752 =====
753
754 * Improve commit_delay handling to reduce fsync()
755 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
756
757   Ideally this requires a separate test program that can be run
758   at initdb time or optionally later.
759
760 * %Add an option to sync() before fsync()'ing checkpoint files
761 * Add program to test if fsync has a delay compared to non-fsync
762
763
764 Cache Usage
765 ===========
766
767 * Allow free-behind capability for large sequential scans, perhaps using
768   posix_fadvise()
769
770   Posix_fadvise() can control both sequential/random file caching and
771   free-behind behavior, but it is unclear how the setting affects other
772   backends that also have the file open, and the feature is not supported
773   on all operating systems.
774
775 * Speed up COUNT(*)
776
777   We could use a fixed row count and a +/- count to follow MVCC
778   visibility rules, or a single cached value could be used and
779   invalidated if anyone modifies the table.  Another idea is to
780   get a count directly from a unique index, but for this to be
781   faster than a sequential scan it must avoid access to the heap
782   to obtain tuple visibility information.
783
784 * Allow data to be pulled directly from indexes
785
786   Currently indexes do not have enough tuple visibility information 
787   to allow data to be pulled from the index without also accessing 
788   the heap.  One way to allow this is to set a bit to index tuples 
789   to indicate if a tuple is currently visible to all transactions 
790   when the first valid heap lookup happens.  This bit would have to 
791   be cleared when a heap tuple is expired.
792
793
794 * Consider automatic caching of queries at various levels:
795
796         o Parsed query tree
797         o Query execute plan
798         o Query results
799
800 * Allow sequential scans to take advantage of other concurrent
801   sequentiqal scans, also called "Synchronised Scanning"
802
803   One possible implementation is to start sequential scans from the lowest
804   numbered buffer in the shared cache, and when reaching the end wrap
805   around to the beginning, rather than always starting sequential scans
806   at the start of the table.
807
808
809 Vacuum
810 ======
811
812 * Improve speed with indexes
813
814   For large table adjustements during VACUUM FULL, it is faster to 
815   reindex rather than update the index.
816
817 * Reduce lock time during VACUUM FULL by moving tuples with read lock,
818   then write lock and truncate table
819
820   Moved tuples are invisible to other backends so they don't require a
821   write lock. However, the read lock promotion to write lock could lead
822   to deadlock situations.
823
824 * Auto-fill the free space map by scanning the buffer cache or by
825   checking pages written by the background writer
826 * Create a bitmap of pages that need vacuuming
827
828   Instead of sequentially scanning the entire table, have the background
829   writer or some other process record pages that have expired rows, then
830   VACUUM can look at just those pages rather than the entire table.  In
831   the event of a system crash, the bitmap would probably be invalidated.
832   One complexity is that index entries still have to be vacuumed, and
833   doing this without an index scan (by using the heap values to find the
834   index entry) might be slow and unreliable, especially for user-defined
835   index functions.
836
837 * %Add system view to show free space map contents
838
839
840 * Auto-vacuum
841
842         o Use free-space map information to guide refilling
843         o %Issue log message to suggest VACUUM FULL if a table is nearly
844           empty?
845         o Improve xid wraparound detection by recording per-table rather
846           than per-database
847
848
849 Locking
850 =======
851
852 * Add code to detect an SMP machine and handle spinlocks accordingly
853   from distributted.net, http://www1.distributed.net/source,
854   in client/common/cpucheck.cpp
855
856   On SMP machines, it is possible that locks might be released shortly,
857   while on non-SMP machines, the backend should sleep so the process
858   holding the lock can complete and release it.
859
860 * Fix priority ordering of read and write light-weight locks (Neil)
861
862
863 Startup Time Improvements
864 =========================
865
866 * Experiment with multi-threaded backend [thread]
867
868   This would prevent the overhead associated with process creation. Most
869   operating systems have trivial process creation time compared to
870   database startup overhead, but a few operating systems (WIn32,
871   Solaris) might benefit from threading.  Also explore the idea of
872   a single session using multiple threads to execute a query faster.
873
874 * Add connection pooling
875
876   It is unclear if this should be done inside the backend code or done
877   by something external like pgpool. The passing of file descriptors to
878   existing backends is one of the difficulties with a backend approach.
879
880
881 Write-Ahead Log
882 ===============
883
884 * Eliminate need to write full pages to WAL before page modification [wal]
885
886   Currently, to protect against partial disk page writes, we write
887   full page images to WAL before they are modified so we can correct any
888   partial page writes during recovery.  These pages can also be
889   eliminated from point-in-time archive files.
890
891         o  When off, write CRC to WAL and check file system blocks
892            on recovery
893
894            If CRC check fails during recovery, remember the page in case
895            a later CRC for that page properly matches.
896
897         o  Write full pages during file system write and not when
898            the page is modified in the buffer cache
899
900            This allows most full page writes to happen in the background
901            writer.  It might cause problems for applying WAL on recovery
902            into a partially-written page, but later the full page will be
903            replaced from WAL.
904
905 * Allow WAL traffic to be streamed to another server for stand-by
906   replication
907 * Reduce WAL traffic so only modified values are written rather than
908   entire rows?
909 * Allow the pg_xlog directory location to be specified during initdb
910   with a symlink back to the /data location
911 * Allow WAL information to recover corrupted pg_controldata
912 * Find a way to reduce rotational delay when repeatedly writing
913   last WAL page
914
915   Currently fsync of WAL requires the disk platter to perform a full
916   rotation to fsync again. One idea is to write the WAL to different
917   offsets that might reduce the rotational delay.
918
919 * Allow buffered WAL writes and fsync
920
921   Instead of guaranteeing recovery of all committed transactions, this
922   would provide improved performance by delaying WAL writes and fsync
923   so an abrupt operating system restart might lose a few seconds of
924   committed transactions but still be consistent.  We could perhaps
925   remove the 'fsync' parameter (which results in an an inconsistent
926   database) in favor of this capability.
927
928
929 Optimizer / Executor
930 ====================
931
932 * Add missing optimizer selectivities for date, r-tree, etc
933 * Allow ORDER BY ... LIMIT # to select high/low value without sort or
934   index using a sequential scan for highest/lowest values
935
936   Right now, if no index exists, ORDER BY ... LIMIT # requires we sort
937   all values to return the high/low value.  Instead The idea is to do a 
938   sequential scan to find the high/low value, thus avoiding the sort.
939   MIN/MAX already does this, but not for LIMIT > 1.
940
941 * Precompile SQL functions to avoid overhead
942 * Create utility to compute accurate random_page_cost value
943 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
944 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
945 * Consider using hash buckets to do DISTINCT, rather than sorting
946
947   This would be beneficial when there are few distinct values.  This is
948   already used by GROUP BY.
949
950 * Log queries where the optimizer row estimates were dramatically
951   different from the number of rows actually found?
952
953
954 Miscellaneous Performance
955 =========================
956
957 * Do async I/O for faster random read-ahead of data
958
959   Async I/O allows multiple I/O requests to be sent to the disk with
960   results coming back asynchronously.
961
962 * Use mmap() rather than SYSV shared memory or to write WAL files?
963
964   This would remove the requirement for SYSV SHM but would introduce
965   portability issues. Anonymous mmap (or mmap to /dev/zero) is required
966   to prevent I/O overhead.
967
968 * Consider mmap()'ing files into a backend?
969
970   Doing I/O to large tables would consume a lot of address space or
971   require frequent mapping/unmapping.  Extending the file also causes
972   mapping problems that might require mapping only individual pages,
973   leading to thousands of mappings.  Another problem is that there is no
974   way to _prevent_ I/O to disk from the dirty shared buffers so changes
975   could hit disk before WAL is written.
976
977 * Add a script to ask system configuration questions and tune postgresql.conf
978 * Merge xmin/xmax/cmin/cmax back into three header fields
979
980   Before subtransactions, there used to be only three fields needed to
981   store these four values. This was possible because only the current
982   transaction looks at the cmin/cmax values. If the current transaction
983   created and expired the row the fields stored where xmin (same as
984   xmax), cmin, cmax, and if the transaction was expiring a row from a
985   another transaction, the fields stored were xmin (cmin was not
986   needed), xmax, and cmax. Such a system worked because a transaction
987   could only see rows from another completed transaction. However,
988   subtransactions can see rows from outer transactions, and once the
989   subtransaction completes, the outer transaction continues, requiring
990   the storage of all four fields. With subtransactions, an outer
991   transaction can create a row, a subtransaction expire it, and when the
992   subtransaction completes, the outer transaction still has to have
993   proper visibility of the row's cmin, for example, for cursors.
994
995   One possible solution is to create a phantom cid which represents a
996   cmin/cmax pair and is stored in local memory.  Another idea is to
997   store both cmin and cmax only in local memory.
998
999 * Research storing disk pages with no alignment/padding
1000
1001
1002 Source Code
1003 ===========
1004
1005 * Add use of 'const' for variables in source tree
1006 * Rename some /contrib modules from pg* to pg_*
1007 * Move some things from /contrib into main tree
1008 * Move some /contrib modules out to their own project sites
1009 * %Remove warnings created by -Wcast-align
1010 * Move platform-specific ps status display info from ps_status.c to ports
1011 * Add optional CRC checksum to heap and index pages
1012 * Improve documentation to build only interfaces (Marc)
1013 * Remove or relicense modules that are not under the BSD license, if possible
1014 * %Remove memory/file descriptor freeing before ereport(ERROR)
1015 * Acquire lock on a relation before building a relcache entry for it
1016 * %Promote debug_query_string into a server-side function current_query()
1017 * %Allow the identifier length to be increased via a configure option
1018 * Remove Win32 rename/unlink looping if unnecessary
1019 * Allow cross-compiling by generating the zic database on the target system
1020 * Improve NLS maintenace of libpgport messages linked onto applications
1021 * Allow ecpg to work with MSVC and BCC
1022 * Add xpath_array() to /contrib/xml2 to return results as an array
1023 * Allow building in directories containing spaces
1024
1025   This is probably not possible because 'gmake' and other compiler tools
1026   do not fully support quoting of paths with spaces.
1027
1028 * Allow installing to directories containing spaces
1029
1030   This is possible if proper quoting is added to the makefiles for the
1031   install targets.  Because PostgreSQL supports relocatable installs, it
1032   is already possible to install into a directory that doesn't contain 
1033   spaces and then copy the install to a directory with spaces.
1034
1035 * Fix sgmltools so PDFs can be generated with bookmarks
1036 * %Clean up compiler warnings (especially with gcc version 4)
1037 * Add function to return the thread safety status of libpq and ecpg
1038 * Use UTF8 encoding for NLS messages so all server encodings can
1039   read them properly
1040 * Update Bonjour to work with newer cross-platform SDK
1041 * Remove BeOS and QNX-specific code
1042
1043 * Win32
1044
1045         o Remove configure.in check for link failure when cause is found
1046         o Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1047           1.4 is released
1048         o Remove psql newline patch when we find out why mingw outputs an
1049           extra newline
1050         o Allow psql to use readline once non-US code pages work with
1051           backslashes
1052         o Re-enable timezone output on log_line_prefix '%t' when a
1053           shorter timezone string is available
1054         o Fix problem with shared memory on the Win32 Terminal Server
1055
1056
1057 * Wire Protocol Changes
1058
1059         o Allow dynamic character set handling
1060         o Add decoded type, length, precision
1061         o Use compression?
1062         o Update clients to use data types, typmod, schema.table.column names
1063           of result sets using new query protocol
1064
1065
1066 ---------------------------------------------------------------------------
1067
1068
1069 Developers who have claimed items are:
1070 --------------------------------------
1071 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
1072 * Andrew is Andrew Dunstan <andrew@dunslane.net>
1073 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
1074 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
1075     Family Health Network
1076 * Claudio is Claudio Natoli <claudio.natoli@memetrics.com>
1077 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
1078 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
1079 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
1080 * Greg is Greg Sabino Mullane <greg@turnstep.com>
1081 * Hiroshi is Hiroshi Inoue <Inoue@tpf.co.jp>
1082 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
1083 * Joe is Joe Conway <mail@joeconway.com>
1084 * Karel is Karel Zak <zakkr@zf.jcu.cz>
1085 * Magnus is Magnus Hagander <mha@sollentuna.net>
1086 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
1087 * Matthew T. O'Connor <matthew@zeut.net>
1088 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
1089 * Neil is Neil Conway <neilc@samurai.com>
1090 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
1091 * Peter is Peter Eisentraut <peter_e@gmx.net>
1092 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
1093 * Rod is Rod Taylor <pg@rbt.ca>
1094 * Simon is Simon Riggs <simon@2ndquadrant.com>
1095 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
1096 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
1097 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat