]> granicus.if.org Git - postgresql/blob - doc/src/FAQ/TODO.html
522d5918d0e1db75f774617d950b527d19ca468c
[postgresql] / doc / src / FAQ / TODO.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <title>PostgreSQL TODO List</title>
6 <meta name="generator" content="HTML::TextToHTML v2.25"/>
7 </head>
8 <body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#A00000" alink="#0000FF">
9 <h1><a name="section_1">PostgreSQL TODO List</a></h1>
10 <p>Current maintainer:     Bruce Momjian (<a href="mailto:bruce@momjian.us">bruce@momjian.us</a>)<br/>
11 Last updated:           Thu Oct 12 18:32:58 EDT 2006
12 </p>
13 <p>The most recent version of this document can be viewed at<br/>
14 <a href="http://www.postgresql.org/docs/faqs.TODO.html">http://www.postgresql.org/docs/faqs.TODO.html</a>.
15 </p>
16 <p><strong>A hyphen, "-", marks changes that will appear in the upcoming 8.3 release.</strong><br/>
17 <strong>A percent sign, "%", marks items that are easier to implement.</strong>
18 </p>
19 <p>Bracketed items, "[<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?"></a>]", have more detail.
20 </p>
21 <p>This list contains all known PostgreSQL bugs and feature requests. If<br/>
22 you would like to work on an item, please read the Developer's FAQ<br/>
23 first.
24 </p>
25 <h1><a name="section_2">Administration</a></h1>
26
27 <ul>
28   <li>Allow major upgrades without dump/reload, perhaps using pg_upgrade 
29   [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?pg_upgrade">pg_upgrade</a>]
30   </li><li>Check for unreferenced table files created by transactions that were
31   in-progress when the server terminated abruptly
32 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00096.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00096.php</a>
33 </p>
34   </li><li>Allow administrators to safely terminate individual sessions either
35   via an SQL function or SIGTERM 
36 <p>  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.
40   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00174.php</a>
41 </p>
42   </li><li>%Set proper permissions on non-system schemas during db creation
43 <p>  Currently all schemas are owned by the super-user because they are
44   copied from the template1 database.
45 </p>
46   </li><li>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
48   clause
49   </li><li>Add function to report the time of the most recent server reload
50   </li><li>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   </li><li>Allow log_min_messages to be specified on a per-module basis
54 <p>  This would allow administrators to see more detailed information from
55   specific sections of the backend, e.g. checkpoints, autovacuum, etc.
56   Another idea is to allow separate configuration files for each module,
57   or allow arbitrary SET commands to be passed to them.
58 </p>
59   </li><li>Simplify ability to create partitioned tables
60 <p>  This would allow creation of partitioned tables without requiring
61   creation of rules for INSERT/UPDATE/DELETE, and constraints for
62   rapid partition selection.  Options could include range and hash
63   partition selection.
64 </p>
65   </li><li>Allow auto-selection of partitioned tables for min/max() operations
66   </li><li>Allow more complex user/database default GUC settings
67 <p>  Currently, ALTER USER and ALTER DATABASE support per-user and
68   per-database defaults.  Consider adding per-user-and-database
69   defaults so things like search_path can be defaulted for a 
70   specific user connecting to a specific database.
71 </p>
72   </li><li>Improve replication solutions
73   <ul>
74     <li>Load balancing
75 <p>          You can use any of the master/slave replication servers to use a
76           standby server for data warehousing. To allow read/write queries to
77           multiple servers, you need multi-master replication like pgcluster.
78 </p>
79     </li><li>Allow replication over unreliable or non-persistent links
80   </li></ul>
81   </li><li>Configuration files
82   <ul>
83     <li>Allow commenting of variables in postgresql.conf to restore them
84           to defaults
85 <p>          Currently, if a variable is commented out, it keeps the
86           previous uncommented value until a server restarted.
87           <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01481.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01481.php</a>
88 </p>
89     </li><li>Allow pg_hba.conf to specify host names along with IP addresses
90 <p>          Host name lookup could occur when the postmaster reads the
91           pg_hba.conf file, or when the backend starts.  Another
92           solution would be to reverse lookup the connection IP and
93           check that hostname against the host names in pg_hba.conf.
94           We could also then check that the host name maps to the IP
95           address.
96 </p>
97     </li><li>%Allow postgresql.conf file values to be changed via an SQL
98           API, perhaps using SET GLOBAL
99     </li><li>Allow the server to be stopped/restarted via an SQL API
100     </li><li>Issue a warning if a change-on-restart-only postgresql.conf value
101           is modified  and the server config files are reloaded
102     </li><li>Mark change-on-restart-only values in postgresql.conf
103   </li></ul>
104   </li><li>Tablespaces
105   <ul>
106     <li>Allow a database in tablespace t1 with tables created in
107           tablespace t2 to be used as a template for a new database created
108           with default tablespace t2
109 <p>          All objects in the default database tablespace must have default
110           tablespace specifications. This is because new databases are
111           created by copying directories. If you mix default tablespace
112           tables and tablespace-specified tables in the same directory,
113           creating a new database from such a mixed directory would create a
114           new database with tables that had incorrect explicit tablespaces.
115           To fix this would require modifying pg_class in the newly copied
116           database, which we don't currently do.
117 </p>
118     </li><li>Allow reporting of which objects are in which tablespaces
119 <p>          This item is difficult because a tablespace can contain objects
120           from multiple databases. There is a server-side function that
121           returns the databases which use a specific tablespace, so this
122           requires a tool that will call that function and connect to each
123           database to find the objects in each database for that tablespace.
124 </p>
125     </li><li>%Add a GUC variable to control the tablespace for temporary objects
126           and sort files
127 <p>          It could start with a random tablespace from a supplied list and
128           cycle through the list.
129 </p>
130     </li><li>Allow WAL replay of CREATE TABLESPACE to work when the directory
131           structure on the recovery computer is different from the original
132     </li><li>Allow per-tablespace quotas
133   </li></ul>
134   </li><li>Point-In-Time Recovery (PITR)
135   <ul>
136     <li>Allow a warm standby system to also allow read-only statements
137             [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?pitr">pitr</a>]
138 <p>            This is useful for checking PITR recovery.
139 </p>
140     </li><li>%Create dump tool for write-ahead logs for use in determining
141             transaction id for point-in-time recovery
142     </li><li>Allow the PITR process to be debugged and data examined
143   </li></ul>
144 </li></ul>
145 <h1><a name="section_3">Monitoring</a></h1>
146
147 <ul>
148   <li>Allow server log information to be output as INSERT statements
149 <p>  This would allow server log information to be easily loaded into
150   a database for analysis.
151 </p>
152   </li><li>%Add ability to monitor the use of temporary sort files
153 </li></ul>
154 <h1><a name="section_4">Data Types</a></h1>
155
156 <ul>
157   <li>Improve the MONEY data type
158 <p>  Change the MONEY data type to use DECIMAL internally, with special
159   locale-aware output formatting.
160   <a href="http://archives.postgresql.org/pgsql-general/2005-08/msg01432.php">http://archives.postgresql.org/pgsql-general/2005-08/msg01432.php</a>
161   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01107.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01107.php</a>
162 </p>
163   </li><li>Change NUMERIC to enforce the maximum precision
164   </li><li>Add NUMERIC division operator that doesn't round?
165 <p>  Currently NUMERIC _rounds_ the result to the specified precision.  
166   This means division can return a result that multiplied by the 
167   divisor is greater than the dividend, e.g. this returns a value &gt; 10:
168 </p>
169 </li></ul>
170 <p>    SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
171 </p>
172 <p>  The positive modulus result returned by NUMERICs might be considered<br/>
173   inaccurate, in one sense.
174 </p>
175 <ul>
176   <li>Fix data types where equality comparison isn't intuitive, e.g. box
177   </li><li>Allow user-defined types to specify a type modifier at table creation
178   time
179   </li><li>Allow user-defined types to accept 'typmod' parameters
180 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-08/msg01142.php">http://archives.postgresql.org/pgsql-hackers/2005-08/msg01142.php</a>
181   <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00012.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00012.php</a>
182   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00149.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00149.php</a>
183 </p>
184   </li><li>Add support for public SYNONYMs
185 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00519.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00519.php</a>
186 </p>
187   </li><li>Fix CREATE CAST on DOMAINs
188 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-05/msg00072.php">http://archives.postgresql.org/pgsql-hackers/2006-05/msg00072.php</a>
189   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01681.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01681.php</a>
190 </p>
191   </li><li>Add Globally/Universally Unique Identifier (GUID/UUID)
192 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-09/msg00209.php">http://archives.postgresql.org/pgsql-patches/2006-09/msg00209.php</a>
193 </p>
194   </li><li>Add support for SQL-standard GENERATED/IDENTITY columns
195 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-07/msg00543.php">http://archives.postgresql.org/pgsql-hackers/2006-07/msg00543.php</a>
196 </p>
197   </li><li>Support a data type with specific enumerated values (ENUM)
198 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00979.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00979.php</a>
199 </p>
200   </li><li>Improve XML support
201 <p>  <a href="http://developer.postgresql.org/index.php/XML_Support">http://developer.postgresql.org/index.php/XML_Support</a>
202 </p>
203   </li><li>Dates and Times
204   <ul>
205     <li>Allow infinite dates and intervals just like infinite timestamps
206     </li><li>Merge hardwired timezone names with the TZ database; allow either 
207           kind everywhere a TZ name is currently taken
208     </li><li>Allow TIMESTAMP WITH TIME ZONE to store the original timezone
209           information, either zone name or offset from UTC [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?timezone">timezone</a>]
210 <p>          If the TIMESTAMP value is stored with a time zone name, interval 
211           computations should adjust based on the time zone rules.
212 </p>
213     </li><li>Fix SELECT '0.01 years'::interval, '0.01 months'::interval
214     </li><li>Add a GUC variable to allow output of interval values in ISO8601 
215           format
216     </li><li>Improve timestamptz subtraction to be DST-aware
217 <p>          Currently, subtracting one date from another that crosses a
218           daylight savings time adjustment can return '1 day 1 hour', but
219           adding that back to the first date returns a time one hour in
220           the future.  This is caused by the adjustment of '25 hours' to
221           '1 day 1 hour', and '1 day' is the same time the next day, even
222           if daylight savings adjustments are involved.
223 </p>
224     </li><li>Fix interval display to support values exceeding 2^31 hours
225     </li><li>Add overflow checking to timestamp and interval arithmetic    
226     </li><li>Add ISO INTERVAL handling
227   </li></ul>
228 </li></ul>
229 <p>                  <a href="http://archives.postgresql.org/pgsql-hackers/2006-01/msg00250.php">http://archives.postgresql.org/pgsql-hackers/2006-01/msg00250.php</a><br/>
230                   <a href="http://archives.postgresql.org/pgsql-bugs/2006-04/msg00248.php">http://archives.postgresql.org/pgsql-bugs/2006-04/msg00248.php</a>
231 </p>
232 <ul>
233   <li>Support ISO INTERVAL syntax if units cannot be determined from
234                   the string, and are supplied after the string
235 <p>                  The SQL standard states that the units after the string
236                   specify the units of the string, e.g. INTERVAL '2' MINUTE
237                   should return '00:02:00'. The current behavior has the units
238                   restrict the interval value to the specified unit or unit
239                   range, INTERVAL '70' SECOND returns '00:00:10'.
240 </p>
241 <p>                  For syntax that isn't uniquely ISO or PG syntax, like '1' or
242                   '1:30', treat as ISO if there is a range specification clause,
243                   and as PG if there no clause is present, e.g. interpret '1:30'
244                   MINUTE TO SECOND as '1 minute 30 seconds', and interpret
245                   '1:30' as '1 hour, 30 minutes'.
246 </p>
247 <p>                  This makes common cases like SELECT INTERVAL '1' MONTH
248                   SQL-standard results. The SQL standard supports a limited
249                   number of unit combinations and doesn't support unit names in
250                   the string. The PostgreSQL syntax is more flexible in the
251                   range of units supported, e.g. PostgreSQL supports '1 year 1
252                   hour', while the SQL standard does not.
253 </p>
254   </li><li>Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
255   </li><li>Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
256                   INTERVAL MONTH), and this should return '12 months'
257   </li><li>Round or truncate values to the requested precision, e.g.
258                   INTERVAL '11 months' AS YEAR should return one or zero
259   </li><li>Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
260   <ul>
261     <li>Arrays
262     <ul>
263       <li>Delay resolution of array expression's data type so assignment
264           coercion can be performed on empty array expressions
265       </li><li>Add support for arrays of domains
266       </li><li>Add support for arrays of complex types
267     </li></ul>
268     </li><li>Binary Data
269     <ul>
270       <li>Improve vacuum of large objects, like /contrib/vacuumlo?
271       </li><li>Add security checking for large objects
272       </li><li>Auto-delete large objects when referencing row is deleted
273 <p>          /contrib/lo offers this functionality.
274 </p>
275       </li><li>Allow read/write into TOAST values like large objects
276 <p>          This requires the TOAST column to be stored EXTERNAL.
277 </p>
278       </li><li>Add API for 64-bit large object access
279 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00781.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00781.php</a>
280 </p>
281     </li></ul>
282   </li></ul>
283 </li></ul>
284 <h1><a name="section_5">Functions</a></h1>
285
286 <ul>
287   <li>Allow INET subnet tests using non-constants to be indexed
288   </li><li>%Add pg_get_acldef(), pg_get_typedefault(), pg_get_attrdef(),
289   pg_get_tabledef(), pg_get_domaindef(), pg_get_functiondef()
290 <p>  These would be for application use, not for use by pg_dump.
291 </p>
292   </li><li>Allow to_date() and to_timestamp() accept localized month names
293   </li><li>Add missing parameter handling in to_char()
294 </li></ul>
295 <p>        <a href="http://archives.postgresql.org/pgsql-hackers/2005-12/msg00948.php">http://archives.postgresql.org/pgsql-hackers/2005-12/msg00948.php</a>
296 </p>
297 <ul>
298   <li>Allow functions to have a schema search path specified at creation time
299   </li><li>Allow substring/replace() to get/set bit values
300   </li><li>Allow to_char() on interval values to accumulate the highest unit
301   requested
302 <p>  Some special format flag would be required to request such
303   accumulation.  Such functionality could also be added to EXTRACT. 
304   Prevent accumulation that crosses the month/day boundary because of
305   the uneven number of days in a month.
306 </p>
307   <ul>
308     <li>to_char(INTERVAL '1 hour 5 minutes', 'MI') =&gt; 65
309     </li><li>to_char(INTERVAL '43 hours 20 minutes', 'MI' ) =&gt; 2600 
310     </li><li>to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') =&gt; 0:1:19:20
311     </li><li>to_char(INTERVAL '3 years 5 months','MM') =&gt; 41
312   </li></ul>
313   </li><li>Add SPI_gettypmod() to return the typemod for a TupleDesc
314   </li><li>Allow inlining of set-returning functions
315 </li></ul>
316 <h1><a name="section_6">Multi-Language Support</a></h1>
317
318 <ul>
319   <li>Add NCHAR (as distinguished from ordinary varchar),
320   </li><li>Allow locale to be set at database creation
321 <p>  Currently locale can only be set during initdb.  No global tables have
322   locale-aware columns.  However, the database template used during
323   database creation might have locale-aware indexes.  The indexes would
324   need to be reindexed to match the new locale.
325 </p>
326   </li><li>Allow encoding on a per-column basis optionally using the ICU library:
327 <p>  Right now only one encoding is allowed per database.  [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?locale">locale</a>]
328   <a href="http://archives.postgresql.org/pgsql-hackers/2005-03/msg00932.php">http://archives.postgresql.org/pgsql-hackers/2005-03/msg00932.php</a>
329   <a href="http://archives.postgresql.org/pgsql-patches/2005-08/msg00309.php">http://archives.postgresql.org/pgsql-patches/2005-08/msg00309.php</a>
330   <a href="http://archives.postgresql.org/pgsql-patches/2006-03/msg00233.php">http://archives.postgresql.org/pgsql-patches/2006-03/msg00233.php</a>
331   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg00662.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg00662.php</a>
332 </p>
333   </li><li>Add CREATE COLLATE?  [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?locale">locale</a>]
334   </li><li>Support multiple simultaneous character sets, per SQL92
335   </li><li>Improve UTF8 combined character handling?
336   </li><li>Add octet_length_server() and octet_length_client()
337   </li><li>Make octet_length_client() the same as octet_length()?
338   </li><li>Fix problems with wrong runtime encoding conversion for NLS message files
339   </li><li>Add URL to more complete multi-byte regression tests
340 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-07/msg00272.php">http://archives.postgresql.org/pgsql-hackers/2005-07/msg00272.php</a>
341 </p>
342   </li><li>Fix ILIKE and regular expressions to handle case insensitivity
343   properly in multibyte encodings
344 <p>  <a href="http://archives.postgresql.org/pgsql-bugs/2005-10/msg00001.php">http://archives.postgresql.org/pgsql-bugs/2005-10/msg00001.php</a>
345   <a href="http://archives.postgresql.org/pgsql-patches/2005-11/msg00173.php">http://archives.postgresql.org/pgsql-patches/2005-11/msg00173.php</a>
346 </p>
347   </li><li>Set client encoding based on the client operating system encoding
348 <p>  Currently client_encoding is set in postgresql.conf, which
349   defaults to the server encoding.
350   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg01696.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg01696.php</a>
351 </p>
352 </li></ul>
353 <h1><a name="section_7">Views / Rules</a></h1>
354
355 <ul>
356   <li>Automatically create rules on views so they are updateable, per SQL99
357 <p>  We can only auto-create rules for simple views.  For more complex
358   cases users will still have to write rules manually.
359   <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00586.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00586.php</a>
360 </p>
361   </li><li>Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
362   </li><li>Allow NOTIFY in rules involving conditionals
363   </li><li>Allow VIEW/RULE recompilation when the underlying tables change
364 <p>  Another issue is whether underlying table changes should be reflected
365   in the view, e.g. should SELECT * show additional columns if they
366   are added after the view is created.
367 </p>
368 </li></ul>
369 <h1><a name="section_8">SQL Commands</a></h1>
370
371 <ul>
372   <li>Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
373   </li><li>Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
374   </li><li>%Allow SET CONSTRAINTS to be qualified by schema/table name
375   </li><li>%Add a separate TRUNCATE permission
376 <p>  Currently only the owner can TRUNCATE a table because triggers are not
377   called, and the table is locked in exclusive mode.
378 </p>
379   </li><li>Allow PREPARE of cursors
380   </li><li>Allow finer control over the caching of prepared query plans
381 <p>  Currently, queries prepared via the libpq API are planned on first
382   execute using the supplied parameters --- allow SQL PREPARE to do the
383   same.  Also, allow control over replanning prepared queries either
384   manually or automatically when statistics for execute parameters
385   differ dramatically from those used during planning.
386 </p>
387   </li><li>Invalidate prepared queries, like INSERT, when the table definition
388   is altered
389   </li><li>Allow LISTEN/NOTIFY to store info in memory rather than tables?
390 <p>  Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
391   such information in memory would improve performance.
392 </p>
393   </li><li>Add optional textual message to NOTIFY
394 <p>  This would allow an informational message to be added to the notify
395   message, perhaps indicating the row modified or other custom
396   information.
397 </p>
398   </li><li>Add a GUC variable to warn about non-standard SQL usage in queries
399   </li><li>Add SQL-standard MERGE command, typically used to merge two tables
400   [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?merge">merge</a>]
401 <p>  This is similar to UPDATE, then for unmatched rows, INSERT.
402   Whether concurrent access allows modifications which could cause
403   row loss is implementation independent.
404 </p>
405   </li><li>Add REPLACE or UPSERT command that does UPDATE, or on failure, INSERT
406   [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?merge">merge</a>]
407 <p>  To implement this cleanly requires that the table have a unique index
408   so duplicate checking can be easily performed.  It is possible to
409   do it without a unique index if we require the user to LOCK the table
410   before the MERGE.
411 </p>
412   </li><li>Add NOVICE output level for helpful messages like automatic sequence/index
413   creation
414   </li><li>Add RESET CONNECTION command to reset all session state
415 <p>  This would include resetting of all variables (RESET ALL), dropping of
416   temporary tables, removing any NOTIFYs, cursors, open transactions,
417   prepared queries, currval()s, etc.  This could be used  for connection
418   pooling.  We could also change RESET ALL to have this functionality.  
419   The difficult of this features is allowing RESET ALL to not affect 
420   changes made by the interface driver for its internal use.  One idea 
421   is for this to be a protocol-only feature.  Another approach is to 
422   notify the protocol when a RESET CONNECTION command is used.
423   <a href="http://archives.postgresql.org/pgsql-patches/2006-04/msg00192.php">http://archives.postgresql.org/pgsql-patches/2006-04/msg00192.php</a>
424 </p>
425   </li><li>Add GUC to issue notice about statements that use unjoined tables
426   </li><li>Allow EXPLAIN to identify tables that were skipped because of 
427   constraint_exclusion
428   </li><li>Allow EXPLAIN output to be more easily processed by scripts
429   </li><li>Enable standard_conforming_strings
430   </li><li>Make standard_conforming_strings the default in 8.3?
431 <p>  When this is done, backslash-quote should be prohibited in non-E''
432   strings because of possible confusion over how such strings treat
433   backslashes.  Basically, '' is always safe for a literal single
434   quote, while \' might or might not be based on the backslash
435   handling rules.
436 </p>
437   </li><li>Simplify dropping roles that have objects in several databases
438   </li><li>Allow COMMENT ON to accept an expression rather than just a string
439   </li><li>Allow the count returned by SELECT, etc to be to represent as an int64
440   to allow a higher range of values
441   </li><li>Make CLUSTER preserve recently-dead tuples per MVCC requirements
442   </li><li>Add SQL99 WITH clause to SELECT
443   </li><li>Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT
444   </li><li>Add DEFAULT .. AS OWNER so permission checks are done as the table
445   owner
446 <p>  This would be useful for SERIAL nextval() calls and CHECK constraints.
447 </p>
448   </li><li>Add a GUC to control whether BEGIN inside a transcation should abort
449   the transaction.
450   </li><li>Allow DISTINCT to work in multiple-argument aggregate calls
451   </li><li>Add column to pg_stat_activity that shows the progress of long-running
452   commands like CREATE INDEX and VACUUM
453   </li><li>Implement SQL:2003 window functions
454   </li><li>CREATE
455   <ul>
456     <li>Allow CREATE TABLE AS to determine column lengths for complex
457           expressions like SELECT col1 || col2
458     </li><li>Use more reliable method for CREATE DATABASE to get a consistent
459           copy of db?
460   </li></ul>
461   </li><li>UPDATE
462   <ul>
463     <li>Allow UPDATE tab SET ROW (col, ...) = (SELECT...)
464 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-07/msg01306.php">http://archives.postgresql.org/pgsql-hackers/2006-07/msg01306.php</a>
465 </p>
466   </li></ul>
467   </li><li>ALTER
468   <ul>
469     <li>%Have ALTER TABLE RENAME rename SERIAL sequence names
470     </li><li>Add ALTER DOMAIN to modify the underlying data type
471     </li><li>%Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
472 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2006-02/msg00168.php">http://archives.postgresql.org/pgsql-patches/2006-02/msg00168.php</a>
473 </p>
474     </li><li>%Allow ALTER TABLE to change constraint deferrability and actions
475     </li><li>Add missing object types for ALTER ... SET SCHEMA
476     </li><li>Allow ALTER TABLESPACE to move to different directories
477     </li><li>Allow databases to be moved to different tablespaces
478     </li><li>Allow moving system tables to other tablespaces, where possible
479 <p>          Currently non-global system tables must be in the default database
480           tablespace. Global system tables can never be moved.
481 </p>
482     </li><li>Prevent parent tables from altering or dropping constraints
483           like CHECK that are inherited by child tables unless CASCADE
484           is used
485     </li><li>%Prevent child tables from altering or dropping constraints
486           like CHECK that were inherited from the parent table
487     </li><li>Have ALTER INDEX update the name of a constraint using that index
488     </li><li>Add ALTER TABLE RENAME CONSTRAINT, update index name also
489   </li></ul>
490   </li><li>CLUSTER
491   <ul>
492     <li>Automatically maintain clustering on a table
493 <p>          This might require some background daemon to maintain clustering
494           during periods of low usage. It might also require tables to be only
495           partially filled for easier reorganization.  Another idea would
496           be to create a merged heap/index data file so an index lookup would
497           automatically access the heap data too.  A third idea would be to
498           store heap rows in hashed groups, perhaps using a user-supplied
499           hash function.
500           <a href="http://archives.postgresql.org/pgsql-performance/2004-08/msg00349.php">http://archives.postgresql.org/pgsql-performance/2004-08/msg00349.php</a>
501 </p>
502     </li><li>%Add default clustering to system tables
503 <p>          To do this, determine the ideal cluster index for each system
504           table and set the cluster setting during initdb.
505 </p>
506   </li></ul>
507   </li><li>COPY
508   <ul>
509     <li>Allow COPY to report error lines and continue
510 <p>          This requires the use of a savepoint before each COPY line is
511           processed, with ROLLBACK on COPY failure.
512 </p>
513     </li><li>Allow COPY on a newly-created table to skip WAL logging
514 <p>          On crash recovery, the table involved in the COPY would
515           be removed or have its heap and index files truncated.  One
516           issue is that no other backend should be able to add to 
517           the table at the same time, which is something that is 
518           currently allowed.
519 </p>
520   </li></ul>
521   </li><li>GRANT/REVOKE
522   <ul>
523     <li>Allow column-level privileges
524     </li><li>%Allow GRANT/REVOKE permissions to be applied to all schema objects
525           with one command
526 <p>          The proposed syntax is:
527 </p><p>                GRANT SELECT ON ALL TABLES IN public TO phpuser;
528                 GRANT SELECT ON NEW TABLES IN public TO phpuser;
529 </p>
530     </li><li>Allow GRANT/REVOKE permissions to be inherited by objects based on
531           schema permissions
532     </li><li>Allow SERIAL sequences to inherit permissions from the base table?
533   </li></ul>
534   </li><li>CURSOR
535   <ul>
536     <li>Allow UPDATE/DELETE WHERE CURRENT OF cursor
537 <p>          This requires using the row ctid to map cursor rows back to the
538           original heap row. This become more complicated if WITH HOLD cursors
539           are to be supported because WITH HOLD cursors have a copy of the row
540           and no FOR UPDATE lock.
541 </p>
542     </li><li>Prevent DROP TABLE from dropping a row referenced by its own open
543           cursor?
544   </li></ul>
545   </li><li>INSERT
546   <ul>
547     <li>Allow INSERT/UPDATE of the system-generated oid value for a row
548     </li><li>In rules, allow VALUES() to contain a mixture of 'old' and 'new'
549           references
550   </li></ul>
551   </li><li>SHOW/SET
552   <ul>
553     <li>Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
554           ANALYZE, and CLUSTER
555     </li><li>Add SET PATH for schemas?
556 <p>          This is basically the same as SET search_path.
557 </p>
558   </li></ul>
559   </li><li>Referential Integrity
560   <ul>
561     <li>Add MATCH PARTIAL referential integrity
562     </li><li>Change foreign key constraint for array -&gt; element to mean element
563           in array?
564     </li><li>Enforce referential integrity for system tables
565     </li><li>Fix problem when cascading referential triggers make changes on
566           cascaded tables, seeing the tables in an intermediate state
567 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php</a>
568           <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php</a>
569 </p>
570     </li><li>Allow DEFERRABLE and end-of-statement UNIQUE constraints?
571 <p>          This would allow UPDATE tab SET col = col + 1 to work if col has
572           a unique index.  Currently, uniqueness checks are done while the
573           command is being executed, rather than at the end of the statement
574           or transaction.
575           <a href="http://people.planetpostgresql.org/greg/index.php?/archives/2006/06/10.html">http://people.planetpostgresql.org/greg/index.php?/archives/2006/06/10.html</a>
576           <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01458.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01458.php</a>
577 </p>
578   </li></ul>
579   </li><li>Server-Side Languages
580   <ul>
581     <li>PL/pgSQL
582     <ul>
583       <li>Fix RENAME to work on variables other than OLD/NEW
584       </li><li>Allow function parameters to be passed by name,
585                   get_employee_salary(12345 AS emp_id, 2001 AS tax_year)
586       </li><li>Add Oracle-style packages  (Pavel)
587 <p>                  A package would be a schema with session-local variables,
588                   public/private functions, and initialization functions.  It
589                   is also possible to implement these capabilities
590                   in all schemas and not use a separate "packages"
591                   syntax at all.
592                   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00384.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00384.php</a>
593 </p>
594       </li><li>Allow handling of %TYPE arrays, e.g. tab.col%TYPE[<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?"></a>]
595       </li><li>Allow listing of record column names, and access to
596                   record columns via variables, e.g. columns := r.(*),
597                   tval2 := r.(colname)
598 <p>                  <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00458.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00458.php</a>
599                   <a href="http://archives.postgresql.org/pgsql-patches/2006-05/msg00302.php">http://archives.postgresql.org/pgsql-patches/2006-05/msg00302.php</a>
600                   <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00031.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00031.php</a>
601 </p>
602       </li><li>Add MOVE
603       </li><li>Add single-step debugging of functions
604       </li><li>Add support for WITH HOLD and SCROLL cursors
605 <p>                  PL/pgSQL cursors should support the same syntax as
606                   backend cursors.
607 </p>
608       </li><li>Allow PL/RETURN to return row or record functions
609 <p>                  <a href="http://archives.postgresql.org/pgsql-patches/2005-11/msg00045.php">http://archives.postgresql.org/pgsql-patches/2005-11/msg00045.php</a>
610 </p>
611       </li><li>Fix memory leak from exceptions
612 <p>                  <a href="http://archives.postgresql.org/pgsql-performance/2006-06/msg00305.php">http://archives.postgresql.org/pgsql-performance/2006-06/msg00305.php</a>
613 </p>
614       </li><li>Fix problems with RETURN NEXT on tables with
615                   dropped/added columns after function creation
616 <p>                  <a href="http://archives.postgresql.org/pgsql-patches/2006-02/msg00165.php">http://archives.postgresql.org/pgsql-patches/2006-02/msg00165.php</a>
617 </p>
618     </li></ul>
619     </li><li>Other
620     <ul>
621       <li>Add table function support to pltcl, plpython
622       </li><li>Add support for polymorphic arguments and return types to
623                   languages other than PL/PgSQL
624       </li><li>Add capability to create and call PROCEDURES
625       </li><li>Add support for OUT and INOUT parameters to languages other 
626                   than PL/PgSQL
627       </li><li>Add PL/Python tracebacks
628 <p>                  <a href="http://archives.postgresql.org/pgsql-patches/2006-02/msg00288.php">http://archives.postgresql.org/pgsql-patches/2006-02/msg00288.php</a>
629 </p>
630     </li></ul>
631   </li></ul>
632 </li></ul>
633 <h1><a name="section_9">Clients</a></h1>
634
635 <ul>
636   <li>Have pg_ctl look at PGHOST in case it is a socket directory?
637   </li><li>Allow pg_ctl to work properly with configuration files located outside
638   the PGDATA directory
639 <p>  pg_ctl can not read the pid file because it isn't located in the
640   config directory but in the PGDATA directory.  The solution is to
641   allow pg_ctl to read and understand postgresql.conf to find the
642   data_directory value.
643 </p>
644   </li><li>psql
645   <ul>
646     <li>Have psql show current values for a sequence
647     </li><li>Move psql backslash database information into the backend, use
648           mnemonic commands? [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?psql">psql</a>]
649 <p>          This would allow non-psql clients to pull the same information out
650           of the database as psql.
651 </p>
652     </li><li>Fix psql's \d commands more consistent
653 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php</a>
654           <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php</a>
655 </p>
656     </li><li>Allow psql \pset boolean variables to set to fixed values, rather
657           than toggle
658     </li><li>Consistently display privilege information for all objects in psql
659     </li><li>Add auto-expanded mode so expanded output is used if the row
660           length is wider than the screen width.  
661 <p>          Consider using auto-expanded mode for backslash commands like \df+.
662 </p>
663     </li><li>Prevent tab completion of SET TRANSACTION from querying the
664           database and therefore preventing the transaction isolation
665           level from being set.
666 <p>          Currently, SET &lt;tab&gt; causes a database lookup to check all
667           supported session variables.  This query causes problems
668           because setting the transaction isolation level must be the
669           first statement of a transaction.
670 </p>
671   </li></ul>
672   </li><li>pg_dump
673   <ul>
674     <li>%Add dumping of comments on index columns and composite type columns
675     </li><li>%Add full object name to the tag field.  eg. for operators we need
676           '=(integer, integer)', instead of just '='.
677     </li><li>Add pg_dumpall custom format dumps?
678     </li><li>Remove unnecessary function pointer abstractions in pg_dump source
679           code
680     </li><li>Allow selection of individual object(s) of all types, not just
681           tables
682     </li><li>In a selective dump, allow dumping of an object and all its 
683           dependencies
684     </li><li>Add options like pg_restore -l and -L to pg_dump
685     </li><li>Stop dumping CASCADE on DROP TYPE commands in clean mode
686     </li><li>Allow pg_dump --clean to drop roles that own objects or have
687           privileges
688     </li><li>Add -f to pg_dumpall
689   </li></ul>
690   </li><li>ecpg
691   <ul>
692     <li>Docs
693 <p>          Document differences between ecpg and the SQL standard and
694           information about the Informix-compatibility module.
695 </p>
696     </li><li>Solve cardinality &gt; 1 for input descriptors / variables?
697     </li><li>Add a semantic check level, e.g. check if a table really exists
698     </li><li>fix handling of DB attributes that are arrays
699     </li><li>Use backend PREPARE/EXECUTE facility for ecpg where possible
700     </li><li>Implement SQLDA
701     </li><li>Fix nested C comments
702     </li><li>%sqlwarn[<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?6">6</a>] should be 'W' if the PRECISION or SCALE value specified
703     </li><li>Make SET CONNECTION thread-aware, non-standard?
704     </li><li>Allow multidimensional arrays
705     </li><li>Add internationalized message strings
706     </li><li>Implement COPY FROM STDIN
707   </li></ul>
708   </li><li>libpq
709   <ul>
710     <li>Add PQescapeIdentifierConn()
711     </li><li>Prevent PQfnumber() from lowercasing unquoted the column name
712 <p>          PQfnumber() should never have been doing lowercasing, but 
713           historically it has so we need a way to prevent it
714 </p>
715     </li><li>Allow statement results to be automatically batched to the client
716 <p>          Currently, all statement results are transferred to the libpq
717           client before libpq makes the results available to the 
718           application.  This feature would allow the application to make
719           use of the first result rows while the rest are transferred, or
720           held on the server waiting for them to be requested by libpq.
721           One complexity is that a statement like SELECT 1/col could error
722           out mid-way through the result set.
723     </p><ul>
724       <li>Fix SSL retry to avoid useless repeated connection attempts and
725           ensuing misleading error messages
726     </li></ul>
727   </li></ul>
728 </li></ul>
729 <h1><a name="section_10">Triggers</a></h1>
730
731 <ul>
732   <li>Add deferred trigger queue file
733 <p>  Right now all deferred trigger information is stored in backend
734   memory.  This could exhaust memory for very large trigger queues.
735   This item involves dumping large queues into files.
736 </p>
737   </li><li>Allow triggers to be disabled in only the current session.
738 <p>  This is currently possible by starting a multi-statement transaction,
739   modifying the system tables, performing the desired SQL, restoring the
740   system tables, and committing the transaction.  ALTER TABLE ...
741   TRIGGER requires a table lock so it is not ideal for this usage.
742 </p>
743   </li><li>With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
744 <p>  If the dump is known to be valid, allow foreign keys to be added
745   without revalidating the data.
746 </p>
747   </li><li>Allow statement-level triggers to access modified rows
748   </li><li>Support triggers on columns
749 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00107.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00107.php</a>
750 </p>
751   </li><li>Allow AFTER triggers on system tables
752 <p>  System tables are modified in many places in the backend without going
753   through the executor and therefore not causing triggers to fire. To
754   complete this item, the functions that modify system tables will have
755   to fire triggers.
756 </p>
757 </li></ul>
758 <h1><a name="section_11">Dependency Checking</a></h1>
759
760 <ul>
761   <li>Flush cached query plans when the dependent objects change,
762   when the cardinality of parameters changes dramatically, or
763   when new ANALYZE statistics are available
764 <p>  A more complex solution would be to save multiple plans for different
765   cardinality and use the appropriate plan based on the EXECUTE values.
766 </p>
767   </li><li>Track dependencies in function bodies and recompile/invalidate
768 <p>  This is particularly important for references to temporary tables
769   in PL/PgSQL because PL/PgSQL caches query plans.  The only workaround
770   in PL/PgSQL is to use EXECUTE.  One complexity is that a function
771   might itself drop and recreate dependent tables, causing it to
772   invalidate its own query plan.
773 </p>
774 </li></ul>
775 <h1><a name="section_12">Indexes</a></h1>
776
777 <ul>
778   <li>Allow inherited tables to inherit index, UNIQUE constraint, and primary
779   key, foreign key
780   </li><li>UNIQUE INDEX on base column not honored on INSERTs/UPDATEs from
781   inherited table:  INSERT INTO inherit_table (unique_index_col) VALUES
782   (dup) should fail
783 <p>  The main difficulty with this item is the problem of creating an index
784   that can span more than one table.
785 </p>
786   </li><li>Allow SELECT ... FOR UPDATE on inherited tables
787   </li><li>Add UNIQUE capability to non-btree indexes
788   </li><li>Prevent index uniqueness checks when UPDATE does not modify the column
789 <p>  Uniqueness (index) checks are done when updating a column even if the
790   column is not modified by the UPDATE.
791 </p>
792   </li><li>Allow the creation of on-disk bitmap indexes which can be quickly
793   combined with other bitmap indexes
794 <p>  Such indexes could be more compact if there are only a few distinct values.
795   Such indexes can also be compressed.  Keeping such indexes updated can be
796   costly.
797   <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00512.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00512.php</a>
798 </p>
799   </li><li>Allow use of indexes to search for NULLs
800 <p>  One solution is to create a partial index on an IS NULL expression.
801 </p>
802   </li><li>Allow accurate statistics to be collected on indexes with more than
803   one column or expression indexes, perhaps using per-index statistics
804   </li><li>Allow the creation of indexes with mixed ascending/descending
805   specifiers
806 <p>  This is possible now by creating an operator class with reversed sort
807   operators.  One complexity is that NULLs would then appear at the start
808   of the result set, and this might affect certain sort types, like
809   merge join.
810 </p>
811   </li><li>Allow constraint_exclusion to work for UNIONs like it does for
812   inheritance, allow it to work for UPDATE and DELETE statements, and allow
813   it to be used for all statements with little performance impact
814   </li><li>Allow CREATE INDEX to take an additional parameter for use with
815   special index types
816   </li><li>Consider compressing indexes by storing key values duplicated in
817   several rows as a single index entry
818 <p>  This is difficult because it requires datatype-specific knowledge.
819 </p>
820   </li><li>GIST
821   <ul>
822     <li>Add more GIST index support for geometric data types
823     </li><li>Allow GIST indexes to create certain complex index types, like
824           digital trees (see Aoki)
825   </li></ul>
826   </li><li>Hash
827   <ul>
828     <li>Pack hash index buckets onto disk pages more efficiently
829 <p>          Currently only one hash bucket can be stored on a page. Ideally
830           several hash buckets could be stored on a single page and greater
831           granularity used for the hash algorithm.
832 </p>
833     </li><li>Consider sorting hash buckets so entries can be found using a
834           binary search, rather than a linear scan
835     </li><li>In hash indexes, consider storing the hash value with or instead
836           of the key itself
837     </li><li>Add WAL logging for crash recovery
838     </li><li>Allow multi-column hash indexes
839   </li></ul>
840 </li></ul>
841 <h1><a name="section_13">Fsync</a></h1>
842
843 <ul>
844   <li>Improve commit_delay handling to reduce fsync()
845   </li><li>Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
846 <p>  Ideally this requires a separate test program that can be run
847   at initdb time or optionally later.  Consider O_SYNC when
848   O_DIRECT exists.
849 </p>
850   </li><li>%Add an option to sync() before fsync()'ing checkpoint files
851   </li><li>Add program to test if fsync has a delay compared to non-fsync
852 </li></ul>
853 <h1><a name="section_14">Cache Usage</a></h1>
854
855 <ul>
856   <li>Allow free-behind capability for large sequential scans, perhaps using
857   posix_fadvise()
858 <p>  Posix_fadvise() can control both sequential/random file caching and
859   free-behind behavior, but it is unclear how the setting affects other
860   backends that also have the file open, and the feature is not supported
861   on all operating systems.
862 </p>
863   </li><li>Speed up COUNT(*)
864 <p>  We could use a fixed row count and a +/- count to follow MVCC
865   visibility rules, or a single cached value could be used and
866   invalidated if anyone modifies the table.  Another idea is to
867   get a count directly from a unique index, but for this to be
868   faster than a sequential scan it must avoid access to the heap
869   to obtain tuple visibility information.
870 </p>
871   </li><li>Add estimated_count(*) to return an estimate of COUNT(*)
872 <p>  This would use the planner ANALYZE statistics to return an estimated
873   count.
874 </p>
875   </li><li>Allow data to be pulled directly from indexes
876 <p>  Currently indexes do not have enough tuple visibility information 
877   to allow data to be pulled from the index without also accessing 
878   the heap.  One way to allow this is to set a bit on index tuples 
879   to indicate if a tuple is currently visible to all transactions 
880   when the first valid heap lookup happens.  This bit would have to 
881   be cleared when a heap tuple is expired.  
882 </p>
883 <p>  Another idea is to maintain a bitmap of heap pages where all rows
884   are visible to all backends, and allow index lookups to reference 
885   that bitmap to avoid heap lookups, perhaps the same bitmap we might
886   add someday to determine which heap pages need vacuuming.  Frequently
887   accessed bitmaps would have to be stored in shared memory.  One 8k
888   page of bitmaps could track 512MB of heap pages.
889 </p>
890   </li><li>Consider automatic caching of statements at various levels:
891   <ul>
892     <li>Parsed query tree
893     </li><li>Query execute plan
894     </li><li>Query results
895   </li></ul>
896   </li><li>Allow sequential scans to take advantage of other concurrent
897   sequential scans, also called "Synchronised Scanning"
898 <p>  One possible implementation is to start sequential scans from the lowest
899   numbered buffer in the shared cache, and when reaching the end wrap
900   around to the beginning, rather than always starting sequential scans
901   at the start of the table.
902 </p>
903   </li><li>Consider increasing internal areas when shared buffers is increased
904 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-10/msg01419.php">http://archives.postgresql.org/pgsql-hackers/2005-10/msg01419.php</a>
905 </p>
906 </li></ul>
907 <h1><a name="section_15">Vacuum</a></h1>
908
909 <ul>
910   <li>Improve speed with indexes
911 <p>  For large table adjustments during VACUUM FULL, it is faster to 
912   reindex rather than update the index.
913 </p>
914   </li><li>Reduce lock time during VACUUM FULL by moving tuples with read lock,
915   then write lock and truncate table
916 <p>  Moved tuples are invisible to other backends so they don't require a
917   write lock. However, the read lock promotion to write lock could lead
918   to deadlock situations.
919 </p>
920   </li><li>Auto-fill the free space map by scanning the buffer cache or by
921   checking pages written by the background writer
922 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-02/msg01125.php">http://archives.postgresql.org/pgsql-hackers/2006-02/msg01125.php</a>
923   <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00011.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00011.php</a>
924 </p>
925   </li><li>Create a bitmap of pages that need vacuuming
926 <p>  Instead of sequentially scanning the entire table, have the background
927   writer or some other process record pages that have expired rows, then
928   VACUUM can look at just those pages rather than the entire table.  In
929   the event of a system crash, the bitmap would probably be invalidated.
930   One complexity is that index entries still have to be vacuumed, and
931   doing this without an index scan (by using the heap values to find the
932   index entry) might be slow and unreliable, especially for user-defined
933   index functions.
934 </p>
935   </li><li>Allow FSM to return free space toward the beginning of the heap file,
936   in hopes that empty pages at the end can be truncated by VACUUM
937   </li><li>Allow FSM page return free space based on table clustering, to assist
938   in maintaining clustering?
939   </li><li>Consider shrinking expired tuples to just their headers
940 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-03/msg00142.php">http://archives.postgresql.org/pgsql-patches/2006-03/msg00142.php</a>
941 </p>
942   </li><li>Allow heap reuse of UPDATEd rows if no indexed columns are changed,
943   and old and new versions are on the same heap page?
944 <p>  While vacuum handles DELETEs fine, updating of non-indexed columns, like
945   counters, are difficult for VACUUM to handle efficiently.  This method
946   is possible for same-page updates because a single index row can be
947   used to point to both old and new values.
948   <a href="http://archives.postgresql.org/pgsql-hackers/2006-06/msg01305.php">http://archives.postgresql.org/pgsql-hackers/2006-06/msg01305.php</a>
949   <a href="http://archives.postgresql.org/pgsql-hackers/2006-06/msg01534.php">http://archives.postgresql.org/pgsql-hackers/2006-06/msg01534.php</a>
950 </p>
951   </li><li>Reuse index tuples that point to heap tuples that are not visible to 
952   anyone?
953   </li><li>Auto-vacuum
954   <ul>
955     <li>Use free-space map information to guide refilling
956     </li><li>%Issue log message to suggest VACUUM FULL if a table is nearly
957           empty?
958     </li><li>Improve xid wraparound detection by recording per-table rather
959           than per-database
960     </li><li>Consider logging activity either to the logs or a system view
961     </li><li>Turn on by default
962 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg01852.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg01852.php</a>
963 </p>
964   </li></ul>
965 </li></ul>
966 <h1><a name="section_16">Locking</a></h1>
967
968 <ul>
969   <li>Fix priority ordering of read and write light-weight locks (Neil)
970 </li></ul>
971 <h1><a name="section_17">Startup Time Improvements</a></h1>
972
973 <ul>
974   <li>Experiment with multi-threaded backend for backend creation [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?thread">thread</a>]
975 <p>  This would prevent the overhead associated with process creation. Most
976   operating systems have trivial process creation time compared to
977   database startup overhead, but a few operating systems (Win32,
978   Solaris) might benefit from threading.  Also explore the idea of
979   a single session using multiple threads to execute a statement faster.
980 </p>
981   </li><li>Experiment with multi-threaded backend better resource utilization
982 <p>  This would allow a single query to make use of multiple CPU's or
983   multiple I/O channels simultaneously.  One idea is to create a
984   background reader that can pre-fetch sequential and index scan
985   pages needed by other backends.  This could be expanded to allow
986   concurrent reads from multiple devices in a partitioned table.
987 </p>
988   </li><li>Add connection pooling
989 <p>  It is unclear if this should be done inside the backend code or done
990   by something external like pgpool. The passing of file descriptors to
991   existing backends is one of the difficulties with a backend approach.
992 </p>
993 </li></ul>
994 <h1><a name="section_18">Write-Ahead Log</a></h1>
995
996 <ul>
997   <li>Eliminate need to write full pages to WAL before page modification [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?wal">wal</a>]
998 <p>  Currently, to protect against partial disk page writes, we write
999   full page images to WAL before they are modified so we can correct any
1000   partial page writes during recovery.  These pages can also be
1001   eliminated from point-in-time archive files.
1002 </p>
1003   <ul>
1004     <li>When off, write CRC to WAL and check file system blocks
1005            on recovery
1006 <p>           If CRC check fails during recovery, remember the page in case
1007            a later CRC for that page properly matches.
1008 </p>
1009     </li><li>Write full pages during file system write and not when
1010            the page is modified in the buffer cache
1011 <p>           This allows most full page writes to happen in the background
1012            writer.  It might cause problems for applying WAL on recovery
1013            into a partially-written page, but later the full page will be
1014            replaced from WAL.
1015 </p>
1016   </li></ul>
1017   </li><li>Allow WAL traffic to be streamed to another server for stand-by
1018   replication
1019   </li><li>Reduce WAL traffic so only modified values are written rather than
1020   entire rows?
1021   </li><li>Allow the pg_xlog directory location to be specified during initdb
1022   with a symlink back to the /data location
1023   </li><li>Allow WAL information to recover corrupted pg_controldata
1024 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00025.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00025.php</a>
1025 </p>
1026   </li><li>Find a way to reduce rotational delay when repeatedly writing
1027   last WAL page
1028 <p>  Currently fsync of WAL requires the disk platter to perform a full
1029   rotation to fsync again. One idea is to write the WAL to different
1030   offsets that might reduce the rotational delay.
1031 </p>
1032   </li><li>Allow buffered WAL writes and fsync
1033 <p>  Instead of guaranteeing recovery of all committed transactions, this
1034   would provide improved performance by delaying WAL writes and fsync
1035   so an abrupt operating system restart might lose a few seconds of
1036   committed transactions but still be consistent.  We could perhaps
1037   remove the 'fsync' parameter (which results in an an inconsistent
1038   database) in favor of this capability.
1039 </p>
1040   </li><li>Allow WAL logging to be turned off for a table, but the table
1041   might be dropped or truncated during crash recovery [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?walcontrol">walcontrol</a>]
1042 <p>  Allow tables to bypass WAL writes and just fsync() dirty pages on
1043   commit.  This should be implemented using ALTER TABLE, e.g. ALTER 
1044   TABLE PERSISTENCE [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo? DROP | TRUNCATE | DEFAULT "> DROP | TRUNCATE | DEFAULT </a>].  Tables using 
1045   non-default logging should not use referential integrity with 
1046   default-logging tables.  A table without dirty buffers during a
1047   crash could perhaps avoid the drop/truncate.
1048 </p>
1049   </li><li>Allow WAL logging to be turned off for a table, but the table would
1050   avoid being truncated/dropped [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?walcontrol">walcontrol</a>]
1051 <p>  To do this, only a single writer can modify the table, and writes 
1052   must happen only on new pages so the new pages can be removed during
1053   crash recovery.  Readers can continue accessing the table.  Such 
1054   tables probably cannot have indexes.  One complexity is the handling 
1055   of indexes on TOAST tables.
1056 </p>
1057 </li></ul>
1058 <h1><a name="section_19">Optimizer / Executor</a></h1>
1059
1060 <ul>
1061   <li>Improve selectivity functions for geometric operators
1062   </li><li>Allow ORDER BY ... LIMIT # to select high/low value without sort or
1063   index using a sequential scan for highest/lowest values
1064 <p>  Right now, if no index exists, ORDER BY ... LIMIT # requires we sort
1065   all values to return the high/low value.  Instead The idea is to do a 
1066   sequential scan to find the high/low value, thus avoiding the sort.
1067   MIN/MAX already does this, but not for LIMIT &gt; 1.
1068 </p>
1069   </li><li>Precompile SQL functions to avoid overhead
1070   </li><li>Create utility to compute accurate random_page_cost value
1071   </li><li>Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
1072   </li><li>Have EXPLAIN ANALYZE highlight poor optimizer estimates
1073   </li><li>Consider using hash buckets to do DISTINCT, rather than sorting
1074 <p>  This would be beneficial when there are few distinct values.  This is
1075   already used by GROUP BY.
1076 </p>
1077   </li><li>Log statements where the optimizer row estimates were dramatically
1078   different from the number of rows actually found?
1079   </li><li>Consider compressed annealing to search for query plans
1080 <p>  This might replace GEQO, <a href="http://sixdemonbag.org/Djinni">http://sixdemonbag.org/Djinni</a>.
1081 </p>
1082 </li></ul>
1083 <h1><a name="section_20">Miscellaneous Performance</a></h1>
1084
1085 <ul>
1086   <li>Do async I/O for faster random read-ahead of data
1087 <p>  Async I/O allows multiple I/O requests to be sent to the disk with
1088   results coming back asynchronously.
1089 </p>
1090   </li><li>Use mmap() rather than SYSV shared memory or to write WAL files?
1091 <p>  This would remove the requirement for SYSV SHM but would introduce
1092   portability issues. Anonymous mmap (or mmap to /dev/zero) is required
1093   to prevent I/O overhead.
1094 </p>
1095   </li><li>Consider mmap()'ing files into a backend?
1096 <p>  Doing I/O to large tables would consume a lot of address space or
1097   require frequent mapping/unmapping.  Extending the file also causes
1098   mapping problems that might require mapping only individual pages,
1099   leading to thousands of mappings.  Another problem is that there is no
1100   way to _prevent_ I/O to disk from the dirty shared buffers so changes
1101   could hit disk before WAL is written.
1102 </p>
1103   </li><li>Add a script to ask system configuration questions and tune postgresql.conf
1104   </li><li>Merge xmin/xmax/cmin/cmax back into three header fields
1105 <p>  Before subtransactions, there used to be only three fields needed to
1106   store these four values. This was possible because only the current
1107   transaction looks at the cmin/cmax values. If the current transaction
1108   created and expired the row the fields stored where xmin (same as
1109   xmax), cmin, cmax, and if the transaction was expiring a row from a
1110   another transaction, the fields stored were xmin (cmin was not
1111   needed), xmax, and cmax. Such a system worked because a transaction
1112   could only see rows from another completed transaction. However,
1113   subtransactions can see rows from outer transactions, and once the
1114   subtransaction completes, the outer transaction continues, requiring
1115   the storage of all four fields. With subtransactions, an outer
1116   transaction can create a row, a subtransaction expire it, and when the
1117   subtransaction completes, the outer transaction still has to have
1118   proper visibility of the row's cmin, for example, for cursors.
1119 </p>
1120 <p>  One possible solution is to create a phantom cid which represents a
1121   cmin/cmax pair and is stored in local memory.  Another idea is to
1122   store both cmin and cmax only in local memory.
1123 </p>
1124   </li><li>Consider ways of storing rows more compactly on disk
1125   <ul>
1126     <li>Support a smaller header for short variable-length fields?
1127 <p>          One idea is to create zero-or-one-byte-header versions 
1128           of varlena data types.  In involves setting the high-bit and 
1129           0-127 length in the single-byte header, or clear the high bit
1130           and store the 7-bit ASCII value in the rest of the byte.
1131           The small-header versions have no alignment requirements.
1132           <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01372.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01372.php</a>
1133 </p>
1134     </li><li>Reduce the row header size?
1135   </li></ul>
1136 </li></ul>
1137 <h1><a name="section_21">Source Code</a></h1>
1138
1139 <ul>
1140   <li>Add use of 'const' for variables in source tree
1141   </li><li>Move some things from /contrib into main tree
1142   </li><li>Move some /contrib modules out to their own project sites
1143 <p>  Particularly, move GPL-licensed /contrib/userlock and 
1144   /contrib/dbmirror/clean_pending.pl.
1145 </p>
1146   </li><li>%Remove warnings created by -Wcast-align
1147   </li><li>Move platform-specific ps status display info from ps_status.c to ports
1148   </li><li>Add optional CRC checksum to heap and index pages
1149   </li><li>Improve documentation to build only interfaces (Marc)
1150   </li><li>Remove or relicense modules that are not under the BSD license, if possible
1151   </li><li>%Remove memory/file descriptor freeing before ereport(ERROR)
1152   </li><li>Acquire lock on a relation before building a relcache entry for it
1153   </li><li>%Promote debug_query_string into a server-side function current_query()
1154   </li><li>%Allow the identifier length to be increased via a configure option
1155   </li><li>Allow cross-compiling by generating the zic database on the target system
1156   </li><li>Improve NLS maintenance of libpgport messages linked onto applications
1157   </li><li>Allow ecpg to work with MSVC and BCC
1158   </li><li>Add xpath_array() to /contrib/xml2 to return results as an array
1159   </li><li>Allow building in directories containing spaces
1160 <p>  This is probably not possible because 'gmake' and other compiler tools
1161   do not fully support quoting of paths with spaces.
1162 </p>
1163   </li><li>Fix sgmltools so PDFs can be generated with bookmarks
1164   </li><li>Use UTF8 encoding for NLS messages so all server encodings can
1165   read them properly
1166   </li><li>Update Bonjour to work with newer cross-platform SDK
1167   </li><li>Split out libpq pgpass and environment documentation sections to make
1168   it easier for non-developers to find
1169   </li><li>Improve port/qsort() to handle sorts with 50% unique and 50% duplicate
1170   value [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?qsort">qsort</a>]
1171 <p>  This involves choosing better pivot points for the quicksort.
1172 </p>
1173   </li><li>Consider detoasting keys before sorting
1174   </li><li>Consider GnuTLS if OpenSSL license becomes a problem
1175 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-05/msg00040.php">http://archives.postgresql.org/pgsql-patches/2006-05/msg00040.php</a>
1176 </p>
1177   </li><li>Use strlcpy() rather than our StrNCpy() macro
1178 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg02108.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg02108.php</a>
1179 </p>
1180   </li><li>Win32
1181   <ul>
1182     <li>Remove configure.in check for link failure when cause is found
1183     </li><li>Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1184           1.4 is released
1185     </li><li>Remove psql newline patch when we find out why mingw outputs an
1186           extra newline
1187     </li><li>Allow psql to use readline once non-US code pages work with
1188           backslashes
1189     </li><li>Re-enable timezone output on log_line_prefix '%t' when a
1190           shorter timezone string is available
1191     </li><li>Fix problem with shared memory on the Win32 Terminal Server
1192     </li><li>Improve signal handling
1193 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2005-06/msg00027.php">http://archives.postgresql.org/pgsql-patches/2005-06/msg00027.php</a>
1194 </p>
1195     </li><li>Add long file support for binary pg_dump output
1196 <p>          While Win32 supports 64-bit files, the MinGW API does not,
1197           meaning we have to build an fseeko replacement on top of the
1198           Win32 API, and we have to make sure MinGW handles it.  Another
1199           option is to wait for the MinGW project to fix it, or use the
1200           code from the LibGW32C project as a guide.
1201 </p>
1202     </li><li>Check WSACancelBlockingCall() for interrupts [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?win32intr">win32intr</a>]
1203   </li></ul>
1204   </li><li>Wire Protocol Changes
1205   <ul>
1206     <li>Allow dynamic character set handling
1207     </li><li>Add decoded type, length, precision
1208     </li><li>Use compression?
1209     </li><li>Update clients to use data types, typmod, <a href="http://schema.table.column">schema.table.column</a>/ names
1210           of result sets using new statement protocol
1211   </li></ul>
1212 </li></ul>
1213 <h1><a name="section_22">Exotic Features</a></h1>
1214
1215 <ul>
1216   <li>Add pre-parsing phase that converts non-ISO syntax to supported
1217   syntax
1218 <p>  This could allow SQL written for other databases to run without
1219   modification.
1220 </p>
1221   </li><li>Allow plug-in modules to emulate features from other databases
1222   </li><li>SQL*Net listener that makes PostgreSQL appear as an Oracle database
1223   to clients
1224   </li><li>Allow statements across databases or servers with transaction
1225   semantics
1226 <p>  This can be done using dblink and two-phase commit.
1227 </p>
1228   </li><li>Add the features of packages
1229   <ul>
1230     <li>Make private objects accessible only to objects in the same schema
1231     </li><li>Allow current_schema.objname to access current schema objects
1232     </li><li>Add session variables
1233     </li><li>Allow nested schemas
1234   </li></ul>
1235   </li><li>Consider allowing control of upper/lower case folding of unquoted
1236   identifiers
1237 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2004-04/msg00818.php">http://archives.postgresql.org/pgsql-hackers/2004-04/msg00818.php</a>
1238 </p>
1239 </li></ul>
1240 <h1><a name="section_23">Features We Do _Not_ Want</a></h1>
1241
1242 <ul>
1243   <li>All backends running as threads in a single process (not wanted)
1244 <p>  This eliminates the process protection we get from the current setup.
1245   Thread creation is usually the same overhead as process creation on
1246   modern systems, so it seems unwise to use a pure threaded model.
1247 </p>
1248   </li><li>Optimizer hints (not wanted)
1249 <p>  Optimizer hints are used to work around problems in the optimizer.  We
1250   would rather have the problems reported and fixed.
1251   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00506.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00506.php</a>
1252   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00517.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00517.php</a>
1253   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00663.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00663.php</a>
1254 </p>
1255   </li><li>Allow AS in "SELECT col AS label" to be optional (not wanted)
1256 <p>  Because we support postfix operators, it isn't possible to make AS
1257   optional and continue to use bison.
1258   <a href="http://archives.postgresql.org/pgsql-sql/2006-08/msg00164.php">http://archives.postgresql.org/pgsql-sql/2006-08/msg00164.php</a>
1259 </p>
1260 </li></ul>
1261 <hr/>
1262
1263 <h2><a name="section_23_1">Developers who have claimed items are:</a></h2>
1264 <ul>
1265   <li>Alvaro is Alvaro Herrera &lt;<a href="mailto:alvherre@dcc.uchile.cl">alvherre@dcc.uchile.cl</a>&gt;
1266   </li><li>Andrew is Andrew Dunstan &lt;<a href="mailto:andrew@dunslane.net">andrew@dunslane.net</a>&gt;
1267   </li><li>Bruce is Bruce Momjian &lt;<a href="mailto:bruce@momjian.us">bruce@momjian.us</a>&gt; of EnterpriseDB
1268   </li><li>Christopher is Christopher Kings-Lynne &lt;<a href="mailto:chriskl@familyhealth.com.au">chriskl@familyhealth.com.au</a>&gt; of
1269     Family Health Network
1270   </li><li>D'Arcy is D'Arcy J.M. Cain &lt;<a href="mailto:darcy@druid.net">darcy@druid.net</a>&gt; of The Cain Gang Ltd.
1271   </li><li>David is David Fetter &lt;<a href="mailto:david@fetter.org">david@fetter.org</a>&gt;
1272   </li><li>Fabien is Fabien Coelho &lt;<a href="mailto:coelho@cri.ensmp.fr">coelho@cri.ensmp.fr</a>&gt;
1273   </li><li>Gavin is Gavin Sherry &lt;<a href="mailto:swm@linuxworld.com.au">swm@linuxworld.com.au</a>&gt; of Alcove Systems Engineering
1274   </li><li>Greg is Greg Sabino Mullane &lt;<a href="mailto:greg@turnstep.com">greg@turnstep.com</a>&gt;
1275   </li><li>Jan is Jan Wieck &lt;<a href="mailto:JanWieck@Yahoo.com">JanWieck@Yahoo.com</a>&gt; of Afilias, Inc.
1276   </li><li>Joe is Joe Conway &lt;<a href="mailto:mail@joeconway.com">mail@joeconway.com</a>&gt;
1277   </li><li>Karel is Karel Zak &lt;<a href="mailto:zakkr@zf.jcu.cz">zakkr@zf.jcu.cz</a>&gt;
1278   </li><li>Magnus is Magnus Hagander &lt;<a href="mailto:mha@sollentuna.net">mha@sollentuna.net</a>&gt;
1279   </li><li>Marc is Marc Fournier &lt;<a href="mailto:scrappy@hub.org">scrappy@hub.org</a>&gt; of PostgreSQL, Inc.
1280   </li><li>Matthew T. O'Connor &lt;<a href="mailto:matthew@zeut.net">matthew@zeut.net</a>&gt;
1281   </li><li>Michael is Michael Meskes &lt;<a href="mailto:meskes@postgresql.org">meskes@postgresql.org</a>&gt; of Credativ
1282   </li><li>Neil is Neil Conway &lt;<a href="mailto:neilc@samurai.com">neilc@samurai.com</a>&gt;
1283   </li><li>Oleg is Oleg Bartunov &lt;<a href="mailto:oleg@sai.msu.su">oleg@sai.msu.su</a>&gt;
1284   </li><li>Pavel is Pavel Stehule &lt;<a href="mailto:pavel.stehule@hotmail.com">pavel.stehule@hotmail.com</a>&gt;
1285   </li><li>Peter is Peter Eisentraut &lt;<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>&gt;
1286   </li><li>Philip is Philip Warner &lt;<a href="mailto:pjw@rhyme.com.au">pjw@rhyme.com.au</a>&gt; of Albatross Consulting Pty. Ltd.
1287   </li><li>Rod is Rod Taylor &lt;<a href="mailto:pg@rbt.ca">pg@rbt.ca</a>&gt;
1288   </li><li>Simon is Simon Riggs &lt;<a href="mailto:simon@2ndquadrant.com">simon@2ndquadrant.com</a>&gt;
1289   </li><li>Stephan is Stephan Szabo &lt;<a href="mailto:sszabo@megazone23.bigpanda.com">sszabo@megazone23.bigpanda.com</a>&gt;
1290   </li><li>Tatsuo is Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; of SRA OSS, Inc. Japan
1291   </li><li>Teodor is Teodor Sigaev &lt;<a href="mailto:teodor@sigaev.ru">teodor@sigaev.ru</a>&gt;
1292   </li><li>Tom is Tom Lane &lt;<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>&gt; of Red Hat
1293 </li></ul>
1294
1295 </body>
1296 </html>