]> granicus.if.org Git - postgresql/blob - doc/src/FAQ/TODO.html
8194deb50705c4a3b894e94bcba3af311be60cdf
[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:           Fri Mar  7 14:18:54 EST 2008
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.  There is also a developer's wiki at<br/>
24 <a href="http://developer.postgresql.org">http://developer.postgresql.org</a>.
25 </p>
26 <h1><a name="section_2">Administration</a></h1>
27
28 <ul>
29   <li>Allow administrators to safely terminate individual sessions either
30   via an SQL function or SIGTERM
31 <p>  Lock table corruption following SIGTERM of an individual backend
32   has been reported in 8.0.  A possible cause was fixed in 8.1, but
33   it is unknown whether other problems exist.  This item mostly
34   requires additional testing rather than of writing any new code.
35 </p>
36 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00174.php</a>
37 </p>
38   </li><li>Check for unreferenced table files created by transactions that were
39   in-progress when the server terminated abruptly
40 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00096.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00096.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 copied
44   from the template1 database.  However, since all objects are inherited
45   from the template database, it is not clear that setting schemas to the db
46   owner is correct.
47 </p>
48   </li><li>Add function to report the time of the most recent server reload
49   </li><li>Allow statistics collector information to be pulled from the collector
50   process directly, rather than requiring the collector to write a
51   filesystem file twice a second?
52   </li><li>Allow log_min_messages to be specified on a per-module basis
53 <p>  This would allow administrators to see more detailed information from
54   specific sections of the backend, e.g. checkpoints, autovacuum, etc.
55   Another idea is to allow separate configuration files for each module,
56   or allow arbitrary SET commands to be passed to them.
57 </p>
58   </li><li>Simplify ability to create partitioned tables
59 <p>  This would allow creation of partitioned tables without requiring
60   creation of triggers or rules for INSERT/UPDATE/DELETE, and constraints
61   for rapid partition selection.  Options could include range and hash
62   partition selection.
63 </p>
64 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg00375.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg00375.php</a>
65   <a href="http://archives.postgresql.org/pgsql-hackers/2007-04/msg00151.php">http://archives.postgresql.org/pgsql-hackers/2007-04/msg00151.php</a>
66 </p>
67   </li><li>Allow auto-selection of partitioned tables for min/max() operations
68   </li><li>Allow more complex user/database default GUC settings
69 <p>  Currently ALTER USER and ALTER DATABASE support per-user and
70   per-database defaults.  Consider adding per-user-and-database
71   defaults so things like search_path can be defaulted for a
72   specific user connecting to a specific database.
73 </p>
74   </li><li>Allow custom variable classes that can restrict who can set the values
75 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg00911.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg00911.php</a>
76 </p>
77   </li><li>Implement the SQL standard mechanism whereby REVOKE ROLE revokes only
78   the privilege granted by the invoking role, and not those granted
79   by other roles
80 <p>  <a href="http://archives.postgresql.org/pgsql-bugs/2007-05/msg00010.php">http://archives.postgresql.org/pgsql-bugs/2007-05/msg00010.php</a>
81 </p>
82   </li><li>Allow SSL authentication/encryption over unix domain sockets
83 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-12/msg00924.php">http://archives.postgresql.org/pgsql-hackers/2007-12/msg00924.php</a>
84 </p>
85   </li><li>Allow client certificate names to be checked against the client
86   hostname
87 <p>  This is already implemented in
88   libpq/fe-secure.c::verify_peer_name_matches_certificate() but the code
89   is commented out.
90 </p>
91   </li><li>Configuration files
92   <ul>
93     <li>Allow pg_hba.conf to specify host names along with IP addresses
94 <p>          Host name lookup could occur when the postmaster reads the
95           pg_hba.conf file, or when the backend starts.  Another
96           solution would be to reverse lookup the connection IP and
97           check that hostname against the host names in pg_hba.conf.
98           We could also then check that the host name maps to the IP
99           address.
100 </p>
101     </li><li>%Allow postgresql.conf file values to be changed via an SQL
102           API, perhaps using SET GLOBAL
103     </li><li>Allow the server to be stopped/restarted via an SQL API
104     </li><li>Issue a warning if a change-on-restart-only postgresql.conf value
105           is modified  and the server config files are reloaded
106   </li></ul>
107   </li><li>Tablespaces
108   <ul>
109     <li>Allow a database in tablespace t1 with tables created in
110           tablespace t2 to be used as a template for a new database created
111           with default tablespace t2
112 <p>          Currently all objects in the default database tablespace must
113           have default tablespace specifications. This is because new
114           databases are created by copying directories. If you mix default
115           tablespace tables and tablespace-specified tables in the same
116           directory, creating a new database from such a mixed directory
117           would create a new database with tables that had incorrect
118           explicit tablespaces.  To fix this would require modifying
119           pg_class in the newly copied database, which we don't currently
120           do.
121 </p>
122     </li><li>Allow reporting of which objects are in which tablespaces
123 <p>          This item is difficult because a tablespace can contain objects
124           from multiple databases. There is a server-side function that
125           returns the databases which use a specific tablespace, so this
126           requires a tool that will call that function and connect to each
127           database to find the objects in each database for that tablespace.
128 </p>
129     </li><li>Allow WAL replay of CREATE TABLESPACE to work when the directory
130           structure on the recovery computer is different from the original
131     </li><li>Allow per-tablespace quotas
132   </li></ul>
133   </li><li>Point-In-Time Recovery (PITR)
134   <ul>
135     <li>Allow a warm standby system to also allow read-only statements
136             [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?pitr">pitr</a>]
137 <p>            <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg00050.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg00050.php</a>
138 </p>
139     </li><li>%Create dump tool for write-ahead logs for use in determining
140             transaction id for point-in-time recovery
141 <p>            This is useful for checking PITR recovery.
142 </p>
143     </li><li>Allow recovery.conf to support the same syntax as
144             postgresql.conf, including quoting
145 <p>            <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00497.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00497.php</a>
146 </p>
147   </li></ul>
148 </li></ul>
149 <h1><a name="section_3">Data Types</a></h1>
150
151 <ul>
152   <li>Change NUMERIC to enforce the maximum precision
153   </li><li>Reduce storage space for small NUMERICs
154 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg01331.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg01331.php</a>
155   <a href="http://archives.postgresql.org/pgsql-patches/2007-02/msg00505.php">http://archives.postgresql.org/pgsql-patches/2007-02/msg00505.php</a>
156 </p>
157   </li><li>Fix data types where equality comparison isn't intuitive, e.g. box
158   </li><li>Add support for public SYNONYMs
159 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00519.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00519.php</a>
160 </p>
161   </li><li>Fix CREATE CAST on DOMAINs
162 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-05/msg00072.php">http://archives.postgresql.org/pgsql-hackers/2006-05/msg00072.php</a>
163   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01681.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01681.php</a>
164 </p>
165   </li><li>Add support for SQL-standard GENERATED/IDENTITY columns
166 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-07/msg00543.php">http://archives.postgresql.org/pgsql-hackers/2006-07/msg00543.php</a>
167   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00038.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00038.php</a>
168   <a href="http://archives.postgresql.org/pgsql-hackers/2007-05/msg00344.php">http://archives.postgresql.org/pgsql-hackers/2007-05/msg00344.php</a>
169   <a href="http://archives.postgresql.org/pgsql-patches/2007-05/msg00076.php">http://archives.postgresql.org/pgsql-patches/2007-05/msg00076.php</a>
170   <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg00604.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg00604.php</a>
171 </p>
172   </li><li>Improve XML support
173 <p>  <a href="http://developer.postgresql.org/index.php/XML_Support">http://developer.postgresql.org/index.php/XML_Support</a>
174 </p>
175   </li><li>Consider placing all sequences in a single table, or create a system
176   view
177 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php">http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php</a>
178 </p>
179   </li><li>Allow the UUID type to accept non-standard formats
180 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg01214.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg01214.php</a>
181 </p>
182   </li><li>Dates and Times
183   <ul>
184     <li>Allow infinite dates and intervals just like infinite timestamps
185     </li><li>Merge hardwired timezone names with the TZ database; allow either
186           kind everywhere a TZ name is currently taken
187     </li><li>Allow TIMESTAMP WITH TIME ZONE to store the original timezone
188           information, either zone name or offset from UTC [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?timezone">timezone</a>]
189 <p>          If the TIMESTAMP value is stored with a time zone name, interval
190           computations should adjust based on the time zone rules.
191 </p>
192     </li><li>Fix SELECT '0.01 years'::interval, '0.01 months'::interval
193     </li><li>Add a GUC variable to allow output of interval values in ISO8601
194           format
195     </li><li>Have timestamp subtraction not call justify_hours()?
196 <p>          <a href="http://archives.postgresql.org/pgsql-sql/2006-10/msg00059.php">http://archives.postgresql.org/pgsql-sql/2006-10/msg00059.php</a>
197 </p>
198     </li><li>Improve timestamptz subtraction to be DST-aware
199 <p>          Currently subtracting one date from another that crosses a
200           daylight savings time adjustment can return '1 day 1 hour', but
201           adding that back to the first date returns a time one hour in
202           the future.  This is caused by the adjustment of '25 hours' to
203           '1 day 1 hour', and '1 day' is the same time the next day, even
204           if daylight savings adjustments are involved.
205 </p>
206     </li><li>Fix interval display to support values exceeding 2^31 hours
207     </li><li>Add overflow checking to timestamp and interval arithmetic
208     </li><li>Extend timezone code to allow 64-bit values so we can
209           represent years beyond 2038
210 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01363.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01363.php</a>
211 </p>
212     </li><li>Use LC_TIME for localized weekday/month names, rather than
213           LC_MESSAGES
214 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg00390.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg00390.php</a>
215 </p>
216     </li><li>Add ISO INTERVAL handling
217   </li></ul>
218 </li></ul>
219 <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/>
220                   <a href="http://archives.postgresql.org/pgsql-bugs/2006-04/msg00248.php">http://archives.postgresql.org/pgsql-bugs/2006-04/msg00248.php</a>
221 </p>
222 <ul>
223   <li>Support ISO INTERVAL syntax if units cannot be determined from
224                   the string, and are supplied after the string
225 <p>                  The SQL standard states that the units after the string
226                   specify the units of the string, e.g. INTERVAL '2' MINUTE
227                   should return '00:02:00'. The current behavior has the units
228                   restrict the interval value to the specified unit or unit
229                   range, INTERVAL '70' SECOND returns '00:00:10'.
230 </p>
231 <p>                  For syntax that isn't uniquely ISO or PG syntax, like '1' or
232                   '1:30', treat as ISO if there is a range specification clause,
233                   and as PG if there no clause is present, e.g. interpret '1:30'
234                   MINUTE TO SECOND as '1 minute 30 seconds', and interpret
235                   '1:30' as '1 hour, 30 minutes'.
236 </p>
237 <p>                  This makes common cases like SELECT INTERVAL '1' MONTH
238                   SQL-standard results. The SQL standard supports a limited
239                   number of unit combinations and doesn't support unit names in
240                   the string. The PostgreSQL syntax is more flexible in the
241                   range of units supported, e.g. PostgreSQL supports '1 year 1
242                   hour', while the SQL standard does not.
243 </p>
244   </li><li>Add support for year-month syntax, INTERVAL '50-6' YEAR
245                   TO MONTH
246   </li><li>Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1
247                   year' AS INTERVAL MONTH), and this should return '12 months'
248   </li><li>Round or truncate values to the requested precision, e.g.
249                   INTERVAL '11 months' AS YEAR should return one or zero
250   </li><li>Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
251   <ul>
252     <li>Arrays
253     <ul>
254       <li>Delay resolution of array expression's data type so assignment
255           coercion can be performed on empty array expressions
256       </li><li>Add support for arrays of domains
257 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2007-05/msg00114.php">http://archives.postgresql.org/pgsql-patches/2007-05/msg00114.php</a>
258 </p>
259       </li><li>Allow single-byte header storage for array elements
260     </li></ul>
261     </li><li>Binary Data
262     <ul>
263       <li>Improve vacuum of large objects, like contrib/vacuumlo?
264       </li><li>Add security checking for large objects
265       </li><li>Auto-delete large objects when referencing row is deleted
266 <p>          contrib/lo offers this functionality.
267 </p>
268       </li><li>Allow read/write into TOAST values like large objects
269 <p>          This requires the TOAST column to be stored EXTERNAL.
270 </p>
271       </li><li>Add API for 64-bit large object access
272 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00781.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00781.php</a>
273 </p>
274     </li></ul>
275     </li><li>MONEY data type
276     <ul>
277       <li>Add locale-aware MONEY type, and support multiple currencies
278 <p>          <a href="http://archives.postgresql.org/pgsql-general/2005-08/msg01432.php">http://archives.postgresql.org/pgsql-general/2005-08/msg01432.php</a>
279           <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg01181.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg01181.php</a>
280 </p>
281       </li><li>MONEY dumps in a locale-specific format making it difficult to
282           restore to a system with a different locale
283       </li><li>Allow MONEY to be easily cast to/from other numeric data types
284     </li></ul>
285   </li></ul>
286 </li></ul>
287 <h1><a name="section_4">Functions</a></h1>
288
289 <ul>
290   <li>Allow INET subnet tests using non-constants to be indexed
291   </li><li>Allow to_date() and to_timestamp() accept localized month names
292   </li><li>Fix to_date()-related functions to consistently issue errors
293 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg00915.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg00915.php</a>
294 </p>
295   </li><li>Add missing parameter handling in to_char()
296 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-12/msg00948.php">http://archives.postgresql.org/pgsql-hackers/2005-12/msg00948.php</a>
297 </p>
298   </li><li>Allow substring/replace() to get/set bit values
299   </li><li>Allow to_char() on interval values to accumulate the highest unit
300   requested
301 <p>  Some special format flag would be required to request such
302   accumulation.  Such functionality could also be added to EXTRACT.
303   Prevent accumulation that crosses the month/day boundary because of
304   the uneven number of days in a month.
305 </p>
306   <ul>
307     <li>to_char(INTERVAL '1 hour 5 minutes', 'MI') =&gt; 65
308     </li><li>to_char(INTERVAL '43 hours 20 minutes', 'MI' ) =&gt; 2600
309     </li><li>to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') =&gt; 0:1:19:20
310     </li><li>to_char(INTERVAL '3 years 5 months','MM') =&gt; 41
311   </li></ul>
312   </li><li>Implement inlining of set-returning functions defined in SQL
313   </li><li>Allow SQL-language functions to return results from RETURNING queries
314 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00665.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00665.php</a>
315 </p>
316   </li><li>Allow SQL-language functions to reference parameters by parameter name
317 <p>  Currently SQL-language functions can only refer to dollar parameters,
318   e.g. $1
319 </p>
320   </li><li>Add SPI_gettypmod() to return the typemod for a TupleDesc
321   </li><li>Enforce typmod for function inputs, function results and parameters for
322   spi_prepare'd statements called from PLs
323 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg01403.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg01403.php</a>
324 </p>
325   </li><li>Allow holdable cursors in SPI
326   </li><li>Tighten function permission checks
327 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00568.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00568.php</a>
328 </p>
329   </li><li>Fix IS OF so it matches the ISO specification, and add documentation
330 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2003-08/msg00060.php">http://archives.postgresql.org/pgsql-patches/2003-08/msg00060.php</a>
331   <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg00060.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg00060.php</a>
332 </p>
333   </li><li>Add missing operators for geometric data types
334 <p>  Some geometric types do not have the full suite of geometric operators,
335   e.g. box @&gt; point
336 </p>
337   </li><li>Implement Boyer-Moore searching in strpos()
338 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2007-08/msg00012.php">http://archives.postgresql.org/pgsql-patches/2007-08/msg00012.php</a>
339 </p>
340   </li><li>Prevent malicious functions from being executed with the permissions
341   of unsuspecting users
342 <p>  Index functions are safe, so VACUUM and ANALYZE are safe too. 
343   Triggers, CHECK and DEFAULT expressions, and rules are still vulnerable.
344   <a href="http://archives.postgresql.org/pgsql-hackers/2008-01/msg00268.php">http://archives.postgresql.org/pgsql-hackers/2008-01/msg00268.php</a>
345 </p>
346   </li><li>Reduce memory usage of aggregates in set returning functions
347 <p>  <a href="http://archives.postgresql.org/pgsql-performance/2008-01/msg00031.php">http://archives.postgresql.org/pgsql-performance/2008-01/msg00031.php</a>
348 </p>
349 </li></ul>
350 <h1><a name="section_5">Multi-Language Support</a></h1>
351
352 <ul>
353   <li>Add NCHAR (as distinguished from ordinary varchar),
354   </li><li>Allow locale to be set at database creation
355 <p>  Currently locale can only be set during initdb.  No global tables have
356   locale-aware columns.  However, the database template used during
357   database creation might have locale-aware indexes.  The indexes would
358   need to be reindexed to match the new locale.
359 </p>
360   </li><li>Allow encoding on a per-column basis optionally using the ICU library:
361 <p>  Right now only one encoding is allowed per database.  [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?locale">locale</a>]
362 </p>
363 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-03/msg00932.php">http://archives.postgresql.org/pgsql-hackers/2005-03/msg00932.php</a>
364   <a href="http://archives.postgresql.org/pgsql-patches/2005-08/msg00309.php">http://archives.postgresql.org/pgsql-patches/2005-08/msg00309.php</a>
365   <a href="http://archives.postgresql.org/pgsql-patches/2006-03/msg00233.php">http://archives.postgresql.org/pgsql-patches/2006-03/msg00233.php</a>
366   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg00662.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg00662.php</a>
367 </p>
368   </li><li>Add CREATE COLLATE?  [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?locale">locale</a>]
369   </li><li>Support multiple simultaneous character sets, per SQL92
370   </li><li>Improve UTF8 combined character handling?
371   </li><li>Add octet_length_server() and octet_length_client()
372   </li><li>Make octet_length_client() the same as octet_length()?
373   </li><li>Fix problems with wrong runtime encoding conversion for NLS message files
374   </li><li>Add URL to more complete multi-byte regression tests
375 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-07/msg00272.php">http://archives.postgresql.org/pgsql-hackers/2005-07/msg00272.php</a>
376 </p>
377   </li><li>Fix ILIKE and regular expressions to handle case insensitivity
378   properly in multibyte encodings
379 <p>  <a href="http://archives.postgresql.org/pgsql-bugs/2005-10/msg00001.php">http://archives.postgresql.org/pgsql-bugs/2005-10/msg00001.php</a>
380   <a href="http://archives.postgresql.org/pgsql-patches/2005-11/msg00173.php">http://archives.postgresql.org/pgsql-patches/2005-11/msg00173.php</a>
381 </p>
382   </li><li>Set client encoding based on the client operating system encoding
383 <p>  Currently client_encoding is set in postgresql.conf, which
384   defaults to the server encoding.
385   <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg01696.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg01696.php</a>
386 </p>
387 </li></ul>
388 <h1><a name="section_6">Views / Rules</a></h1>
389
390 <ul>
391   <li>Automatically create rules on views so they are updateable, per SQL99
392 <p>  We can only auto-create rules for simple views.  For more complex
393   cases users will still have to write rules manually.
394 </p>
395 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00586.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00586.php</a>
396   <a href="http://archives.postgresql.org/pgsql-patches/2006-08/msg00255.php">http://archives.postgresql.org/pgsql-patches/2006-08/msg00255.php</a>
397 </p>
398   </li><li>Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
399   </li><li>Allow NOTIFY in rules involving conditionals
400   </li><li>Allow VIEW/RULE recompilation when the underlying tables change
401 <p>  Another issue is whether underlying table changes should be reflected
402   in the view, e.g. should SELECT * show additional columns if they
403   are added after the view is created.
404 </p>
405   </li><li>Make it possible to use RETURNING together with conditional DO INSTEAD
406   rules, such as for partitioning setups
407 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-09/msg00577.php">http://archives.postgresql.org/pgsql-hackers/2007-09/msg00577.php</a>
408 </p>
409   </li><li>Add the ability to automatically create materialized views
410 <p>  Right now materialized views require the user to create triggers on the
411   main table to keep the summary table current.  SQL syntax should be able
412   to manager the triggers and summary table automatically.  A more
413   sophisticated implementation would automatically retrieve from the
414   summary table when the main table is referenced, if possible.
415 </p>
416 </li></ul>
417 <h1><a name="section_7">SQL Commands</a></h1>
418
419 <ul>
420   <li>Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
421   </li><li>Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
422   </li><li>%Allow SET CONSTRAINTS to be qualified by schema/table name
423   </li><li>%Add a separate TRUNCATE permission
424 <p>  Currently only the owner can TRUNCATE a table because triggers are not
425   called, and the table is locked in exclusive mode.
426 </p>
427   </li><li>Allow PREPARE of cursors
428   </li><li>Allow finer control over the caching of prepared query plans
429 <p>  Currently queries prepared via the libpq API are planned on first
430   execute using the supplied parameters --- allow SQL PREPARE to do the
431   same.  Also, allow control over replanning prepared queries either
432   manually or automatically when statistics for execute parameters
433   differ dramatically from those used during planning.
434 </p>
435   </li><li>Improve logging of prepared transactions recovered during startup
436 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg00092.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg00092.php</a>
437 </p>
438   </li><li>Allow LISTEN/NOTIFY to store info in memory rather than tables?
439 <p>  Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
440   such information in memory would improve performance.
441 </p>
442   </li><li>Add optional textual message to NOTIFY
443 <p>  This would allow an informational message to be added to the notify
444   message, perhaps indicating the row modified or other custom
445   information.
446 </p>
447   </li><li>Allow multiple identical NOTIFY events to always be communicated to the
448   client, rather than sent as a single notification to the listener
449 <p>  <a href="http://archives.postgresql.org/pgsql-general/2008-01/msg00057.php">http://archives.postgresql.org/pgsql-general/2008-01/msg00057.php</a>
450 </p>
451   </li><li>Add a GUC variable to warn about non-standard SQL usage in queries
452   </li><li>Add SQL-standard MERGE command, typically used to merge two tables
453   [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?merge">merge</a>]
454 <p>  This is similar to UPDATE, then for unmatched rows, INSERT.
455   Whether concurrent access allows modifications which could cause
456   row loss is implementation independent.
457 </p>
458   </li><li>Add REPLACE or UPSERT command that does UPDATE, or on failure, INSERT
459   [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?merge">merge</a>]
460 <p>  To implement this cleanly requires that the table have a unique index
461   so duplicate checking can be easily performed.  It is possible to
462   do it without a unique index if we require the user to LOCK the table
463   before the MERGE.
464 </p>
465 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-11/msg00501.php">http://archives.postgresql.org/pgsql-hackers/2005-11/msg00501.php</a>
466   <a href="http://archives.postgresql.org/pgsql-hackers/2005-11/msg00536.php">http://archives.postgresql.org/pgsql-hackers/2005-11/msg00536.php</a>
467 </p>
468   </li><li>Add NOVICE output level for helpful messages like automatic sequence/index
469   creation
470   </li><li>Add GUC to issue notice about statements that use unjoined tables
471   </li><li>Allow EXPLAIN to identify tables that were skipped because of
472   constraint_exclusion
473   </li><li>Allow EXPLAIN output to be more easily processed by scripts, perhaps XML
474   </li><li>Enable standard_conforming_strings
475   </li><li>Make standard_conforming_strings the default in 8.5?
476 <p>  When this is done, backslash-quote should be prohibited in non-E''
477   strings because of possible confusion over how such strings treat
478   backslashes.  Basically, '' is always safe for a literal single
479   quote, while \' might or might not be based on the backslash
480   handling rules.
481 </p>
482   </li><li>Simplify dropping roles that have objects in several databases
483   </li><li>Allow COMMENT ON to accept an expression rather than just a string
484   </li><li>Allow the count returned by SELECT, etc to be represented as an int64
485   to allow a higher range of values
486   </li><li>Add SQL99 WITH clause to SELECT
487   </li><li>Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT
488 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg01375.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg01375.php</a>
489   <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg00642.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg00642.php</a>
490   <a href="http://archives.postgresql.org/pgsql-patches/2007-03/msg00139.php">http://archives.postgresql.org/pgsql-patches/2007-03/msg00139.php</a>
491 </p>
492   </li><li>Add DEFAULT .. AS OWNER so permission checks are done as the table
493   owner
494 <p>  This would be useful for SERIAL nextval() calls and CHECK constraints.
495 </p>
496   </li><li>Allow DISTINCT to work in multiple-argument aggregate calls
497   </li><li>Add column to pg_stat_activity that shows the progress of long-running
498   commands like CREATE INDEX and VACUUM
499   </li><li>Implement SQL:2003 window functions
500   </li><li>Improve failure message when DROP DATABASE is used on a database that
501   has prepared transactions
502   </li><li>Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause
503 <p>  <a href="http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php">http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php</a>
504   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php</a>
505 </p>
506   </li><li>Increase locking when DROPing objects so dependent objects cannot
507   get dropped while the DROP operation is happening
508 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg00937.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg00937.php</a>
509 </p>
510   </li><li>-<em>Allow AS in "SELECT col AS label" to be optional in certain cases</em>
511   </li><li>Allow INSERT ... DELETE ... RETURNING, namely allow the DELETE ...
512   RETURNING to supply values to the INSERT
513   <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/thrd2.php#00979">http://archives.postgresql.org/pgsql-hackers/2008-02/thrd2.php#00979</a>
514   </li><li>Add comments on system tables/columns using the information in
515   catalogs.sgml
516 <p>  Ideally the information would be pulled from the SGML file
517   automatically.
518 </p>
519   </li><li>CREATE
520   <ul>
521     <li>Allow CREATE TABLE AS to determine column lengths for complex
522           expressions like SELECT col1 || col2
523     </li><li>Have WITH CONSTRAINTS also create constraint indexes
524 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2007-04/msg00149.php">http://archives.postgresql.org/pgsql-patches/2007-04/msg00149.php</a>
525 </p>
526     </li><li>Have CONSTRAINT cname NOT NULL record the contraint name
527 <p>          Right now pg_attribute.attnotnull records the NOT NULL status
528           of the column, but does not record the contraint name
529 </p>
530   </li></ul>
531   </li><li>UPDATE
532   <ul>
533     <li>Allow UPDATE tab SET ROW (col, ...) = (SELECT...)
534 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-07/msg01306.php">http://archives.postgresql.org/pgsql-hackers/2006-07/msg01306.php</a>
535           <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg00865.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg00865.php</a>
536 </p>
537     </li><li>Research self-referential UPDATEs that see inconsistent row versions
538           in read-committed mode
539 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-05/msg00507.php">http://archives.postgresql.org/pgsql-hackers/2007-05/msg00507.php</a>
540           <a href="http://archives.postgresql.org/pgsql-hackers/2007-06/msg00016.php">http://archives.postgresql.org/pgsql-hackers/2007-06/msg00016.php</a>
541 </p>
542     </li><li>Allow GLOBAL temporary tables to exist as empty by default in
543           all sessions
544 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-07/msg00006.php">http://archives.postgresql.org/pgsql-hackers/2007-07/msg00006.php</a>
545 </p>
546   </li></ul>
547   </li><li>ALTER
548   <ul>
549     <li>Have ALTER TABLE RENAME rename SERIAL sequence names
550 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php">http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php</a>
551 </p>
552     </li><li>Have ALTER SEQUENCE RENAME rename the sequence name stored
553           in the sequence table
554 <p>          <a href="http://archives.postgresql.org/pgsql-bugs/2007-09/msg00092.php">http://archives.postgresql.org/pgsql-bugs/2007-09/msg00092.php</a>
555           <a href="http://archives.postgresql.org/pgsql-bugs/2007-10/msg00007.php">http://archives.postgresql.org/pgsql-bugs/2007-10/msg00007.php</a>
556           <a href="http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php">http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php</a>
557 </p>
558     </li><li>Add ALTER DOMAIN to modify the underlying data type
559     </li><li>%Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
560 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2006-02/msg00168.php">http://archives.postgresql.org/pgsql-patches/2006-02/msg00168.php</a>
561 </p>
562     </li><li>%Allow ALTER TABLE to change constraint deferrability and actions
563     </li><li>Add missing object types for ALTER ... SET SCHEMA
564     </li><li>Allow ALTER TABLESPACE to move to different directories
565     </li><li>Allow databases to be moved to different tablespaces
566     </li><li>Allow moving system tables to other tablespaces, where possible
567 <p>          Currently non-global system tables must be in the default database
568           tablespace. Global system tables can never be moved.
569 </p>
570     </li><li>Prevent parent tables from altering or dropping constraints
571           like CHECK that are inherited by child tables unless CASCADE
572           is used
573     </li><li>%Prevent child tables from altering or dropping constraints
574           like CHECK that were inherited from the parent table
575     </li><li>Have ALTER INDEX update the name of a constraint using that index
576     </li><li>Add ALTER TABLE RENAME CONSTRAINT, update index name also
577     </li><li>Allow column display reordering by recording a display,
578           storage, and permanent id for every column?
579 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00782.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00782.php</a>
580 </p>
581   </li></ul>
582   </li><li>CLUSTER
583   <ul>
584     <li>Automatically maintain clustering on a table
585 <p>          This might require some background daemon to maintain clustering
586           during periods of low usage. It might also require tables to be only
587           partially filled for easier reorganization.  Another idea would
588           be to create a merged heap/index data file so an index lookup would
589           automatically access the heap data too.  A third idea would be to
590           store heap rows in hashed groups, perhaps using a user-supplied
591           hash function.
592           <a href="http://archives.postgresql.org/pgsql-performance/2004-08/msg00349.php">http://archives.postgresql.org/pgsql-performance/2004-08/msg00349.php</a>
593 </p>
594     </li><li>%Add default clustering to system tables
595 <p>          To do this, determine the ideal cluster index for each system
596           table and set the cluster setting during initdb.
597 </p>
598     </li><li>%Add VERBOSE option to report tables as they are processed,
599           like VACUUM VERBOSE
600   </li></ul>
601   </li><li>COPY
602   <ul>
603     <li>Allow COPY to report error lines and continue
604 <p>          This requires the use of a savepoint before each COPY line is
605           processed, with ROLLBACK on COPY failure.
606 </p>
607     </li><li>Allow COPY on a newly-created table to skip WAL logging
608 <p>          On crash recovery, the table involved in the COPY would
609           be removed or have its heap and index files truncated.  One
610           issue is that no other backend should be able to add to
611           the table at the same time, which is something that is
612           currently allowed.  This currently is done if the table is
613           created inside the same transaction block as the COPY because
614           no other backends can see the table.
615 </p>
616     </li><li>Consider using a ring buffer for COPY FROM
617 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2008-02/msg00140.php">http://archives.postgresql.org/pgsql-patches/2008-02/msg00140.php</a>
618           <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg01080.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg01080.php</a>
619 </p>
620     </li><li>Allow COPY FROM to create index entries in bulk
621 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg00811.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg00811.php</a>
622 </p>
623   </li></ul>
624   </li><li>GRANT/REVOKE
625   <ul>
626     <li>Allow column-level privileges
627     </li><li>%Allow GRANT/REVOKE permissions to be applied to all schema objects
628           with one command
629 <p>          The proposed syntax is:
630 </p><p>                GRANT SELECT ON ALL TABLES IN public TO phpuser;
631                 GRANT SELECT ON NEW TABLES IN public TO phpuser;
632 </p>
633     </li><li>Allow GRANT/REVOKE permissions to be inherited by objects based on
634           schema permissions
635     </li><li>Allow SERIAL sequences to inherit permissions from the base table?
636   </li></ul>
637   </li><li>CURSOR
638   <ul>
639     <li>Prevent DROP TABLE from dropping a row referenced by its own open
640           cursor?
641   </li></ul>
642   </li><li>INSERT
643   <ul>
644     <li>Allow INSERT/UPDATE of the system-generated oid value for a row
645     </li><li>In rules, allow VALUES() to contain a mixture of 'old' and 'new'
646           references
647   </li></ul>
648   </li><li>SHOW/SET
649   <ul>
650     <li>Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
651           ANALYZE, and CLUSTER
652   </li></ul>
653 </li></ul>
654 <h1><a name="section_8">Referential Integrity</a></h1>
655
656 <ul>
657   <li>Add MATCH PARTIAL referential integrity
658   </li><li>Change foreign key constraint for array -&gt; element to mean element
659   in array?
660   </li><li>Fix problem when cascading referential triggers make changes on
661   cascaded tables, seeing the tables in an intermediate state
662 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php</a>
663   <a href="http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php">http://archives.postgresql.org/pgsql-hackers/2005-09/msg00174.php</a>
664 </p>
665   </li><li>Allow DEFERRABLE and end-of-statement UNIQUE constraints?
666 <p>  This would allow UPDATE tab SET col = col + 1 to work if col has
667   a unique index.  Currently, uniqueness checks are done while the
668   command is being executed, rather than at the end of the statement
669   or transaction.
670   <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>
671   <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg01458.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg01458.php</a>
672 </p>
673   </li><li>Improve referential integrity checks
674 <p>  <a href="http://archives.postgresql.org/pgsql-performance/2005-10/msg00458.php">http://archives.postgresql.org/pgsql-performance/2005-10/msg00458.php</a>
675 </p>
676 </li></ul>
677 <h1><a name="section_9">Server-Side Languages</a></h1>
678
679 <ul>
680   <li>PL/pgSQL
681   <ul>
682     <li>Fix RENAME to work on variables other than OLD/NEW
683 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2002-03/msg00591.php">http://archives.postgresql.org/pgsql-hackers/2002-03/msg00591.php</a>
684           <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg01615.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg01615.php</a>
685           <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg01587.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg01587.php</a>
686 </p>
687     </li><li>Allow function parameters to be passed by name,
688           get_employee_salary(12345 AS emp_id, 2001 AS tax_year)
689     </li><li>Allow handling of %TYPE arrays, e.g. tab.col%TYPE[<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?"></a>]
690     </li><li>Allow listing of record column names, and access to
691           record columns via variables, e.g. columns := r.(*),
692           tval2 := r.(colname)
693 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00458.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00458.php</a>
694           <a href="http://archives.postgresql.org/pgsql-patches/2006-05/msg00302.php">http://archives.postgresql.org/pgsql-patches/2006-05/msg00302.php</a>
695           <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00031.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00031.php</a>
696 </p>
697     </li><li>Add support for SCROLL cursors
698     </li><li>Add support for WITH HOLD cursors
699     </li><li>Allow row and record variables to be set to NULL constants,
700           and allow NULL tests on such variables
701 <p>          Because a row is not scalar, do not allow assignment
702           from NULL-valued scalars.
703 </p>
704 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00070.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00070.php</a>
705 </p>
706   </li></ul>
707   </li><li>Other
708   <ul>
709     <li>Add table function support to pltcl, plpythonu
710     </li><li>Add support for polymorphic arguments and return types to
711           languages other than PL/PgSQL
712     </li><li>Add capability to create and call PROCEDURES
713     </li><li>Add support for OUT and INOUT parameters to languages other
714           than PL/PgSQL
715     </li><li>Add PL/PythonU tracebacks
716 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2006-02/msg00288.php">http://archives.postgresql.org/pgsql-patches/2006-02/msg00288.php</a>
717 </p>
718     </li><li>Allow data to be passed in native language formats, rather
719           than only text
720 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-05/msg00289.php">http://archives.postgresql.org/pgsql-hackers/2007-05/msg00289.php</a>
721 </p>
722   </li></ul>
723 </li></ul>
724 <h1><a name="section_10">Clients</a></h1>
725
726 <ul>
727   <li>Have pg_ctl look at PGHOST in case it is a socket directory?
728   </li><li>Allow pg_ctl to work properly with configuration files located outside
729   the PGDATA directory
730 <p>  pg_ctl can not read the pid file because it isn't located in the
731   config directory but in the PGDATA directory.  The solution is to
732   allow pg_ctl to read and understand postgresql.conf to find the
733   data_directory value.
734 </p>
735   </li><li>psql
736   <ul>
737     <li>Have psql show current values for a sequence
738     </li><li>Move psql backslash database information into the backend, use
739           mnemonic commands? [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?psql">psql</a>]
740 <p>          This would allow non-psql clients to pull the same information out
741           of the database as psql.
742 </p>
743     </li><li>Fix psql's \d commands more consistent
744 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php</a>
745           <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php</a>
746 </p>
747     </li><li>Consistently display privilege information for all objects in psql
748     </li><li>Add auto-expanded mode so expanded output is used if the row
749           length is wider than the screen width.
750 <p>          Consider using auto-expanded mode for backslash commands like \df+.
751 </p>
752     </li><li>Prevent tab completion of SET TRANSACTION from querying the
753           database and therefore preventing the transaction isolation
754           level from being set.
755 <p>          Currently SET &lt;tab&gt; causes a database lookup to check all
756           supported session variables.  This query causes problems
757           because setting the transaction isolation level must be the
758           first statement of a transaction.
759 </p>
760     </li><li>Add a \set variable to control whether \s displays line numbers
761 <p>          Another option is to add \# which lists line numbers, and
762           allows command execution.
763 </p>
764 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00255.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00255.php</a>
765 </p>
766     </li><li>Prevent escape string warnings when object names have
767           backslashes
768 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2008-01/msg00227.php">http://archives.postgresql.org/pgsql-hackers/2008-01/msg00227.php</a>
769 </p>
770     </li><li>Have \d show foreign keys that reference a table's primary key
771 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-04/msg00424.php">http://archives.postgresql.org/pgsql-hackers/2007-04/msg00424.php</a>
772 </p>
773     </li><li>Have \d show child tables that inherit from the specified parent
774     </li><li>Have \l+ show database size, if permissions allow
775 <p>          Ideally it will not generate an error for invalid permissions
776 </p>
777   </li></ul>
778   </li><li>pg_dump / pg_restore
779   <ul>
780     <li>%Add dumping of comments on index columns and composite type columns
781     </li><li>%Add full object name to the tag field.  eg. for operators we need
782           '=(integer, integer)', instead of just '='.
783     </li><li>Add pg_dumpall custom format dumps?
784     </li><li>Allow selection of individual object(s) of all types, not just
785           tables
786     </li><li>In a selective dump, allow dumping of an object and all its
787           dependencies
788     </li><li>Add options like pg_restore -l and -L to pg_dump
789     </li><li>Stop dumping CASCADE on DROP TYPE commands in clean mode
790     </li><li>Allow pg_dump --clean to drop roles that own objects or have
791           privileges
792     </li><li>Change pg_dump so that a comment on the dumped database is
793           applied to the loaded database, even if the database has a
794           different name.  This will require new backend syntax, perhaps
795           COMMENT ON CURRENT DATABASE.
796     </li><li>Remove unnecessary function pointer abstractions in pg_dump source
797           code
798     </li><li>Allow pg_dump to utilize multiple CPUs and I/O channels by dumping
799           multiple objects simultaneously
800 <p>          The difficulty with this is getting multiple dump processes to
801           produce a single dump output file.  It also would require
802           several sessions to share the same snapshot.
803           <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php</a>
804 </p>
805     </li><li>Allow pg_restore to utilize multiple CPUs and I/O channels by
806           restoring multiple objects simultaneously
807 <p>          This might require a pg_restore flag to indicate how many
808           simultaneous operations should be performed.  Only pg_dump's
809           -Fc format has the necessary dependency information.
810           <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg00963.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg00963.php</a>
811 </p>
812     </li><li>To better utilize resources, allow pg_restore to check foreign
813           keys simultaneously, where possible
814     </li><li>Allow pg_restore to create all indexes of a table
815           concurrently, via a single heap scan
816 <p>          This requires a pg_dump -Fc file because that format contains
817           the required dependency information.
818           <a href="http://archives.postgresql.org/pgsql-general/2007-05/msg01274.php">http://archives.postgresql.org/pgsql-general/2007-05/msg01274.php</a>
819 </p>
820     </li><li>Allow pg_restore to load different parts of the COPY data
821           simultaneously
822   </li></ul>
823   </li><li>ecpg
824   <ul>
825     <li>Docs
826 <p>          Document differences between ecpg and the SQL standard and
827           information about the Informix-compatibility module.
828 </p>
829     </li><li>Solve cardinality &gt; 1 for input descriptors / variables?
830     </li><li>Add a semantic check level, e.g. check if a table really exists
831     </li><li>fix handling of DB attributes that are arrays
832     </li><li>Use backend PREPARE/EXECUTE facility for ecpg where possible
833     </li><li>Implement SQLDA
834     </li><li>Fix nested C comments
835     </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
836     </li><li>Make SET CONNECTION thread-aware, non-standard?
837     </li><li>Allow multidimensional arrays
838     </li><li>Add internationalized message strings
839     </li><li>Implement COPY FROM STDIN
840   </li></ul>
841   </li><li>libpq
842   <ul>
843     <li>Add PQescapeIdentifierConn()
844     </li><li>Prevent PQfnumber() from lowercasing unquoted the column name
845 <p>          PQfnumber() should never have been doing lowercasing, but
846           historically it has so we need a way to prevent it
847 </p>
848     </li><li>Allow statement results to be automatically batched to the client
849 <p>          Currently all statement results are transferred to the libpq
850           client before libpq makes the results available to the
851           application.  This feature would allow the application to make
852           use of the first result rows while the rest are transferred, or
853           held on the server waiting for them to be requested by libpq.
854           One complexity is that a statement like SELECT 1/col could error
855           out mid-way through the result set.
856 </p>
857     </li><li>Consider disallowing multiple queries in PQexec() as an
858           additional barrier to SQL injection attacks
859 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg00184.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg00184.php</a>
860 </p>
861     </li><li>Add PQexecf() that allows complex parameter substitution
862 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg01803.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg01803.php</a>
863 </p>
864     </li><li>Add SQLSTATE severity to PGconn return status
865 <p>          <a href="http://archives.postgresql.org/pgsql-interfaces/2007-11/msg00015.php">http://archives.postgresql.org/pgsql-interfaces/2007-11/msg00015.php</a>
866 </p>
867   </li></ul>
868 </li></ul>
869 <h1><a name="section_11">Triggers</a></h1>
870
871 <ul>
872   <li>Add deferred trigger queue file
873 <p>  Right now all deferred trigger information is stored in backend
874   memory.  This could exhaust memory for very large trigger queues.
875   This item involves dumping large queues into files.
876 </p>
877   </li><li>Allow triggers to be disabled in only the current session.
878 <p>  This is currently possible by starting a multi-statement transaction,
879   modifying the system tables, performing the desired SQL, restoring the
880   system tables, and committing the transaction.  ALTER TABLE ...
881   TRIGGER requires a table lock so it is not ideal for this usage.
882 </p>
883   </li><li>With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
884 <p>  If the dump is known to be valid, allow foreign keys to be added
885   without revalidating the data.
886 </p>
887   </li><li>Allow statement-level triggers to access modified rows
888   </li><li>Support triggers on columns
889 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00107.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00107.php</a>
890 </p>
891   </li><li>Allow AFTER triggers on system tables
892 <p>  System tables are modified in many places in the backend without going
893   through the executor and therefore not causing triggers to fire. To
894   complete this item, the functions that modify system tables will have
895   to fire triggers.
896 </p>
897   </li><li>Tighten trigger permission checks
898 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00564.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00564.php</a>
899 </p>
900   </li><li>Allow BEFORE INSERT triggers on views
901 <p>  <a href="http://archives.postgresql.org/pgsql-general/2007-02/msg01466.php">http://archives.postgresql.org/pgsql-general/2007-02/msg01466.php</a>
902 </p>
903   </li><li>Add ability to trigger on TRUNCATE
904 <p>  <a href="http://archives.postgresql.org/pgsql-sql/2008-01/msg00050.php">http://archives.postgresql.org/pgsql-sql/2008-01/msg00050.php</a>
905 </p>
906 </li></ul>
907 <h1><a name="section_12">Indexes</a></h1>
908
909 <ul>
910   <li>Add UNIQUE capability to non-btree indexes
911   </li><li>Prevent index uniqueness checks when UPDATE does not modify the column
912 <p>  Uniqueness (index) checks are done when updating a column even if the
913   column is not modified by the UPDATE.
914 </p>
915   </li><li>Allow the creation of on-disk bitmap indexes which can be quickly
916   combined with other bitmap indexes
917 <p>  Such indexes could be more compact if there are only a few distinct values.
918   Such indexes can also be compressed.  Keeping such indexes updated can be
919   costly.
920 </p>
921 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2005-07/msg00512.php">http://archives.postgresql.org/pgsql-patches/2005-07/msg00512.php</a>
922   <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg01107.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg01107.php</a>
923 </p>
924   </li><li>Allow accurate statistics to be collected on indexes with more than
925   one column or expression indexes, perhaps using per-index statistics
926 <p>  <a href="http://archives.postgresql.org/pgsql-performance/2006-10/msg00222.php">http://archives.postgresql.org/pgsql-performance/2006-10/msg00222.php</a>
927   <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg01131.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg01131.php</a>
928 </p>
929   </li><li>Consider compressing indexes by storing key values duplicated in
930   several rows as a single index entry
931 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00341.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00341.php</a>
932   <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg01264.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg01264.php</a>
933   <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg00465.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg00465.php</a>
934   <a href="http://archives.postgresql.org/pgsql-patches/2007-03/msg00163.php">http://archives.postgresql.org/pgsql-patches/2007-03/msg00163.php</a>
935 </p>
936   </li><li>Add REINDEX CONCURRENTLY, like CREATE INDEX CONCURRENTLY
937 <p>  This is difficult because you must upgrade to an exclusive table lock
938   to replace the existing index file.  CREATE INDEX CONCURRENTLY does not
939   have this complication.  This would allow index compaction without
940   downtime.
941 </p>
942   </li><li>Allow multiple indexes to be created concurrently, ideally via a
943   single heap scan, and have pg_restore use it
944   </li><li>Inheritance
945   <ul>
946     <li>Allow inherited tables to inherit indexes, UNIQUE constraints,
947           and primary/foreign keys
948     </li><li>Honor UNIQUE INDEX on base column in INSERTs/UPDATEs
949           on inherited table, e.g.  INSERT INTO inherit_table
950           (unique_index_col) VALUES (dup) should fail
951 <p>          The main difficulty with this item is the problem of
952           creating an index that can span multiple tables.
953 </p>
954     </li><li>Allow SELECT ... FOR UPDATE on inherited tables
955     </li><li>Require all CHECK constraints to be inherited
956 <p>          <a href="http://archives.postgresql.org/pgsql-bugs/2007-04/msg00026.php">http://archives.postgresql.org/pgsql-bugs/2007-04/msg00026.php</a>
957 </p>
958   </li></ul>
959   </li><li>GIST
960   <ul>
961     <li>Add more GIST index support for geometric data types
962     </li><li>Allow GIST indexes to create certain complex index types, like
963           digital trees (see Aoki)
964   </li></ul>
965   </li><li>Hash
966 </li></ul>
967 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-09/msg00051.php">http://archives.postgresql.org/pgsql-hackers/2007-09/msg00051.php</a>
968 </p>
969 <ul>
970   <li>Pack hash index buckets onto disk pages more efficiently
971 <p>          Currently only one hash bucket can be stored on a page. Ideally
972           several hash buckets could be stored on a single page and greater
973           granularity used for the hash algorithm.
974 </p>
975 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2004-06/msg00168.php">http://archives.postgresql.org/pgsql-hackers/2004-06/msg00168.php</a>
976 </p>
977   </li><li>Consider sorting hash buckets so entries can be found using a
978           binary search, rather than a linear scan
979   </li><li>In hash indexes, consider storing the hash value with or instead
980           of the key itself
981   </li><li>Add WAL logging for crash recovery
982   </li><li>Allow multi-column hash indexes
983   </li><li>During index creation, pre-sort the tuples to improve build speed
984 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg01199.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg01199.php</a>
985 </p>
986 </li></ul>
987 <h1><a name="section_13">Fsync</a></h1>
988
989 <ul>
990   <li>Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
991 <p>  Ideally this requires a separate test program that can be run
992   at initdb time or optionally later.  Consider O_SYNC when
993   O_DIRECT exists.
994 </p>
995   </li><li>Add program to test if fsync has a delay compared to non-fsync
996 </li></ul>
997 <h1><a name="section_14">Cache Usage</a></h1>
998
999 <ul>
1000   <li>Speed up COUNT(*)
1001 <p>  We could use a fixed row count and a +/- count to follow MVCC
1002   visibility rules, or a single cached value could be used and
1003   invalidated if anyone modifies the table.  Another idea is to
1004   get a count directly from a unique index, but for this to be
1005   faster than a sequential scan it must avoid access to the heap
1006   to obtain tuple visibility information.
1007 </p>
1008   </li><li>Provide a way to calculate an "estimated COUNT(*)"
1009 <p>  Perhaps by using the optimizer's cardinality estimates or random
1010   sampling.
1011 </p>
1012 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-11/msg00943.php">http://archives.postgresql.org/pgsql-hackers/2005-11/msg00943.php</a>
1013 </p>
1014   </li><li>Allow data to be pulled directly from indexes
1015 <p>  Currently indexes do not have enough tuple visibility information
1016   to allow data to be pulled from the index without also accessing
1017   the heap.  One way to allow this is to set a bit on index tuples
1018   to indicate if a tuple is currently visible to all transactions
1019   when the first valid heap lookup happens.  This bit would have to
1020   be cleared when a heap tuple is expired.
1021 </p>
1022 <p>  Another idea is to maintain a bitmap of heap pages where all rows
1023   are visible to all backends, and allow index lookups to reference
1024   that bitmap to avoid heap lookups, perhaps the same bitmap we might
1025   add someday to determine which heap pages need vacuuming.  Frequently
1026   accessed bitmaps would have to be stored in shared memory.  One 8k
1027   page of bitmaps could track 512MB of heap pages.
1028 </p>
1029 <p>  A third idea would be for a heap scan to check if all rows are visible
1030   and if so set a per-table flag which can be checked by index scans. 
1031   Any change to the table would have to clear the flag.  To detect
1032   changes during the heap scan a counter could be set at the start and
1033   checked at the end --- if it is the same, the table has not been
1034   modified --- any table change would increment the counter.
1035 </p>
1036   </li><li>Consider automatic caching of statements at various levels:
1037   <ul>
1038     <li>Parsed query tree
1039     </li><li>Query execute plan
1040     </li><li>Query results
1041   </li></ul>
1042   </li><li>Consider increasing internal areas when shared buffers is increased
1043 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2005-10/msg01419.php">http://archives.postgresql.org/pgsql-hackers/2005-10/msg01419.php</a>
1044 </p>
1045   </li><li>Consider decreasing the amount of memory used by PrivateRefCount
1046 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg00797.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg00797.php</a>
1047   <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg00752.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg00752.php</a>
1048 </p>
1049 </li></ul>
1050 <h1><a name="section_15">Vacuum</a></h1>
1051
1052 <ul>
1053   <li>Improve speed with indexes
1054 <p>  For large table adjustments during VACUUM FULL, it is faster to cluster
1055   or reindex rather than update the index.  Also, index updates can bloat
1056   the index.
1057 </p>
1058 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg00024.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg00024.php</a>
1059   <a href="http://archives.postgresql.org/pgsql-performance/2007-05/msg00296.php">http://archives.postgresql.org/pgsql-performance/2007-05/msg00296.php</a>
1060 </p>
1061   </li><li>Auto-fill the free space map by scanning the buffer cache or by
1062   checking pages written by the background writer
1063 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-02/msg01125.php">http://archives.postgresql.org/pgsql-hackers/2006-02/msg01125.php</a>
1064   <a href="http://archives.postgresql.org/pgsql-hackers/2006-03/msg00011.php">http://archives.postgresql.org/pgsql-hackers/2006-03/msg00011.php</a>
1065 </p>
1066   </li><li>Create a bitmap of pages that need vacuuming
1067 <p>  Instead of sequentially scanning the entire table, have the background
1068   writer or some other process record pages that have expired rows, then
1069   VACUUM can look at just those pages rather than the entire table.  In
1070   the event of a system crash, the bitmap would probably be invalidated.
1071   One complexity is that index entries still have to be vacuumed, and
1072   doing this without an index scan (by using the heap values to find the
1073   index entry) might be slow and unreliable, especially for user-defined
1074   index functions.
1075 </p>
1076 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg01188.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg01188.php</a>
1077   <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg00121.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg00121.php</a>
1078 </p>
1079   </li><li>Allow FSM to return free space toward the beginning of the heap file,
1080   in hopes that empty pages at the end can be truncated by VACUUM
1081   </li><li>Allow FSM page return free space based on table clustering, to assist
1082   in maintaining clustering?
1083   </li><li>Improve dead row detection during multi-statement transactions usage
1084 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2007-03/msg00358.php">http://archives.postgresql.org/pgsql-patches/2007-03/msg00358.php</a>
1085 </p>
1086   </li><li>Auto-vacuum
1087   <ul>
1088     <li>%Issue log message to suggest VACUUM FULL if a table is nearly
1089           empty?
1090     </li><li>Improve control of auto-vacuum
1091 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00876.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00876.php</a>
1092 </p>
1093     </li><li>Prevent long-lived temporary tables from causing frozen-xid
1094           advancement starvation
1095 <p>          The problem is that autovacuum cannot vacuum them to set frozen xids;
1096           only the session that created them can do that.
1097           <a href="http://archives.postgresql.org/pgsql-general/2007-06/msg01645.php">http://archives.postgresql.org/pgsql-general/2007-06/msg01645.php</a>
1098 </p>
1099     </li><li>Store per-table autovacuum settings in pg_class.reloptions.
1100 <p>          <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg01440.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg01440.php</a>
1101           <a href="http://archives.postgresql.org/pgsql-hackers/2008-01/msg00724.php">http://archives.postgresql.org/pgsql-hackers/2008-01/msg00724.php</a>
1102 </p>
1103   </li></ul>
1104 </li></ul>
1105 <h1><a name="section_16">Locking</a></h1>
1106
1107 <ul>
1108   <li>Fix priority ordering of read and write light-weight locks (Neil)
1109 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00893.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00893.php</a>
1110   <a href="http://archives.postgresql.org/pgsql-hackers/2004-11/msg00905.php">http://archives.postgresql.org/pgsql-hackers/2004-11/msg00905.php</a>
1111 </p>
1112   </li><li>Fix problem when multiple subtransactions of the same outer transaction
1113   hold different types of locks, and one subtransaction aborts
1114 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg01011.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg01011.php</a>
1115   <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg00001.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg00001.php</a>
1116   <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg00435.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg00435.php</a>
1117 </p>
1118   </li><li>Allow UPDATEs on only non-referential integrity columns not to conflict
1119   with referential integrity locks
1120 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg00073.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg00073.php</a>
1121 </p>
1122   </li><li>Add idle_in_transaction_timeout GUC so locks are not held for long
1123   periods of time
1124   </li><li>Improve deadlock detection when a page cleaning lock conflicts
1125   with a shared buffer that is pinned
1126 <p>  <a href="http://archives.postgresql.org/pgsql-bugs/2008-01/msg00138.php">http://archives.postgresql.org/pgsql-bugs/2008-01/msg00138.php</a>
1127   <a href="http://archives.postgresql.org/pgsql-hackers/2008-01/msg00873.php">http://archives.postgresql.org/pgsql-hackers/2008-01/msg00873.php</a>
1128   <a href="http://archives.postgresql.org/pgsql-committers/2008-01/msg00365.php">http://archives.postgresql.org/pgsql-committers/2008-01/msg00365.php</a>
1129 </p>
1130 </li></ul>
1131 <h1><a name="section_17">Startup Time Improvements</a></h1>
1132
1133 <ul>
1134   <li>Experiment with multi-threaded backend for backend creation [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?thread">thread</a>]
1135 <p>  This would prevent the overhead associated with process creation. Most
1136   operating systems have trivial process creation time compared to
1137   database startup overhead, but a few operating systems (Win32,
1138   Solaris) might benefit from threading.  Also explore the idea of
1139   a single session using multiple threads to execute a statement faster.
1140 </p>
1141 </li></ul>
1142 <h1><a name="section_18">Write-Ahead Log</a></h1>
1143
1144 <ul>
1145   <li>Eliminate need to write full pages to WAL before page modification [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?wal">wal</a>]
1146 <p>  Currently, to protect against partial disk page writes, we write
1147   full page images to WAL before they are modified so we can correct any
1148   partial page writes during recovery.  These pages can also be
1149   eliminated from point-in-time archive files.
1150 </p>
1151   <ul>
1152     <li>When off, write CRC to WAL and check file system blocks
1153            on recovery
1154 <p>           If CRC check fails during recovery, remember the page in case
1155            a later CRC for that page properly matches.
1156 </p>
1157     </li><li>Write full pages during file system write and not when
1158            the page is modified in the buffer cache
1159 <p>           This allows most full page writes to happen in the background
1160            writer.  It might cause problems for applying WAL on recovery
1161            into a partially-written page, but later the full page will be
1162            replaced from WAL.
1163 </p>
1164   </li></ul>
1165   </li><li>Allow WAL traffic to be streamed to another server for stand-by
1166   replication
1167   </li><li>Reduce WAL traffic so only modified values are written rather than
1168   entire rows
1169 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-03/msg01589.php">http://archives.postgresql.org/pgsql-hackers/2007-03/msg01589.php</a>
1170 </p>
1171   </li><li>Allow WAL information to recover corrupted pg_controldata
1172 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-06/msg00025.php">http://archives.postgresql.org/pgsql-patches/2006-06/msg00025.php</a>
1173 </p>
1174   </li><li>Find a way to reduce rotational delay when repeatedly writing
1175   last WAL page
1176 <p>  Currently fsync of WAL requires the disk platter to perform a full
1177   rotation to fsync again. One idea is to write the WAL to different
1178   offsets that might reduce the rotational delay.
1179 </p>
1180   </li><li>Allow WAL logging to be turned off for a table, but the table
1181   might be dropped or truncated during crash recovery [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?walcontrol">walcontrol</a>]
1182 <p>  Allow tables to bypass WAL writes and just fsync() dirty pages on
1183   commit.  This should be implemented using ALTER TABLE, e.g. ALTER
1184   TABLE PERSISTENCE [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo? DROP | TRUNCATE | DEFAULT "> DROP | TRUNCATE | DEFAULT </a>].  Tables using
1185   non-default logging should not use referential integrity with
1186   default-logging tables.  A table without dirty buffers during a
1187   crash could perhaps avoid the drop/truncate.
1188 </p>
1189   </li><li>Allow WAL logging to be turned off for a table, but the table would
1190   avoid being truncated/dropped [<a href="http://momjian.postgresql.org/cgi-bin/pgtodo?walcontrol">walcontrol</a>]
1191 <p>  To do this, only a single writer can modify the table, and writes
1192   must happen only on new pages so the new pages can be removed during
1193   crash recovery.  Readers can continue accessing the table.  Such
1194   tables probably cannot have indexes.  One complexity is the handling
1195   of indexes on TOAST tables.
1196 </p>
1197   </li><li>Speed WAL recovery by allowing more than one page to be prefetched
1198 <p>  This involves having a separate process that can be told which pages
1199   the recovery process will need in the near future.
1200   <a href="http://archives.postgresql.org/pgsql-hackers/2008-02/msg01279.php">http://archives.postgresql.org/pgsql-hackers/2008-02/msg01279.php</a>
1201 </p>
1202 </li></ul>
1203 <h1><a name="section_19">Optimizer / Executor</a></h1>
1204
1205 <ul>
1206   <li>Improve selectivity functions for geometric operators
1207   </li><li>Precompile SQL functions to avoid overhead
1208   </li><li>Create utility to compute accurate random_page_cost value
1209   </li><li>Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
1210   </li><li>Have EXPLAIN ANALYZE issue NOTICE messages when the estimated and
1211   actual row counts differ by a specified percentage
1212   </li><li>Consider using hash buckets to do DISTINCT, rather than sorting
1213 <p>  This would be beneficial when there are few distinct values.  This is
1214   already used by GROUP BY.
1215 </p>
1216   </li><li>Log statements where the optimizer row estimates were dramatically
1217   different from the number of rows actually found?
1218   </li><li>Consider compressed annealing to search for query plans
1219 <p>  This might replace GEQO, <a href="http://sixdemonbag.org/Djinni">http://sixdemonbag.org/Djinni</a>.
1220 </p>
1221   </li><li>Improve merge join performance by allowing mark/restore of
1222   tuple sources
1223 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-01/msg00096.php">http://archives.postgresql.org/pgsql-hackers/2007-01/msg00096.php</a>
1224 </p>
1225 </li></ul>
1226 <h1><a name="section_20">Miscellaneous Performance</a></h1>
1227
1228 <ul>
1229   <li>Do async I/O for faster random read-ahead of data
1230 <p>  Async I/O allows multiple I/O requests to be sent to the disk with
1231   results coming back asynchronously.
1232 </p>
1233 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00820.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00820.php</a>
1234   <a href="http://archives.postgresql.org/pgsql-hackers/2007-12/msg00027.php">http://archives.postgresql.org/pgsql-hackers/2007-12/msg00027.php</a>
1235 </p>
1236   </li><li>Use mmap() rather than SYSV shared memory or to write WAL files?
1237 <p>  This would remove the requirement for SYSV SHM but would introduce
1238   portability issues. Anonymous mmap (or mmap to /dev/zero) is required
1239   to prevent I/O overhead.
1240 </p>
1241   </li><li>Consider mmap()'ing files into a backend?
1242 <p>  Doing I/O to large tables would consume a lot of address space or
1243   require frequent mapping/unmapping.  Extending the file also causes
1244   mapping problems that might require mapping only individual pages,
1245   leading to thousands of mappings.  Another problem is that there is no
1246   way to <u>prevent</u> I/O to disk from the dirty shared buffers so changes
1247   could hit disk before WAL is written.
1248 </p>
1249   </li><li>Add a script to ask system configuration questions and tune postgresql.conf
1250   </li><li>Consider ways of storing rows more compactly on disk
1251   <ul>
1252     <li>Reduce the row header size?
1253     </li><li>Consider reducing on-disk varlena length from four bytes to
1254           two because a heap row cannot be more than 64k in length
1255   </li></ul>
1256   </li><li>Consider increasing NUM_CLOG_BUFFERS
1257   </li><li>Consider having the background writer update the transaction status
1258   hint bits before writing out the page
1259 <p>  Implementing this requires the background writer to have access to system
1260   catalogs and the transaction status log.
1261 </p>
1262   </li><li>Allow user configuration of TOAST thresholds
1263 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2007-02/msg00213.php">http://archives.postgresql.org/pgsql-hackers/2007-02/msg00213.php</a>
1264 </p>
1265   </li><li>Allow configuration of backend priorities via the operating system
1266 <p>  Though backend priorities make priority inversion during lock
1267   waits possible, research shows that this is not a huge problem.
1268 </p>
1269 <p>  <a href="http://archives.postgresql.org/pgsql-general/2007-02/msg00493.php">http://archives.postgresql.org/pgsql-general/2007-02/msg00493.php</a>
1270 </p>
1271   </li><li>Experiment with multi-threaded backend better resource utilization
1272 <p>  This would allow a single query to make use of multiple CPU's or
1273   multiple I/O channels simultaneously.  One idea is to create a
1274   background reader that can pre-fetch sequential and index scan
1275   pages needed by other backends.  This could be expanded to allow
1276   concurrent reads from multiple devices in a partitioned table.
1277 </p>
1278 </li></ul>
1279 <h1><a name="section_21">Source Code</a></h1>
1280
1281 <ul>
1282   <li>Add use of 'const' for variables in source tree
1283   </li><li>Move some things from contrib into main tree
1284   </li><li>%Remove warnings created by -Wcast-align
1285   </li><li>Move platform-specific ps status display info from ps_status.c to ports
1286   </li><li>Add optional CRC checksum to heap and index pages
1287   </li><li>Improve documentation to build only interfaces (Marc)
1288   </li><li>Remove or relicense modules that are not under the BSD license, if possible
1289   </li><li>Acquire lock on a relation before building a relcache entry for it
1290   </li><li>Allow cross-compiling by generating the zic database on the target system
1291   </li><li>Improve NLS maintenance of libpgport messages linked onto applications
1292   </li><li>Clean up casting in contrib/isn
1293 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-11/msg00245.php">http://archives.postgresql.org/pgsql-hackers/2006-11/msg00245.php</a>
1294 </p>
1295   </li><li>Use UTF8 encoding for NLS messages so all server encodings can
1296   read them properly
1297   </li><li>Update Bonjour to work with newer cross-platform SDK
1298 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-09/msg02238.php">http://archives.postgresql.org/pgsql-hackers/2006-09/msg02238.php</a>
1299   <a href="http://archives.postgresql.org/pgsql-patches/2006-10/msg00048.php">http://archives.postgresql.org/pgsql-patches/2006-10/msg00048.php</a>
1300 </p>
1301   </li><li>Consider detoasting keys before sorting
1302   </li><li>Consider GnuTLS if OpenSSL license becomes a problem
1303 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2006-05/msg00040.php">http://archives.postgresql.org/pgsql-patches/2006-05/msg00040.php</a>
1304   <a href="http://archives.postgresql.org/pgsql-hackers/2006-12/msg01213.php">http://archives.postgresql.org/pgsql-hackers/2006-12/msg01213.php</a>
1305 </p>
1306   </li><li>Consider changing documentation format from SGML to XML
1307 <p>  <a href="http://archives.postgresql.org/pgsql-docs/2006-12/msg00152.php">http://archives.postgresql.org/pgsql-docs/2006-12/msg00152.php</a>
1308 </p>
1309   </li><li>Consider making NAMEDATALEN more configurable in future releases
1310   </li><li>Update our code to handle 64-bit timezone files to match the zic
1311   source code, which now uses them
1312   </li><li>Have configure choose integer datetimes by default
1313 <p>  <a href="http://archives.postgresql.org/pgsql-patches/2007-05/msg00046.php">http://archives.postgresql.org/pgsql-patches/2007-05/msg00046.php</a>
1314 </p>
1315   </li><li>Support scoped IPv6 addresses
1316 <p>  <a href="http://archives.postgresql.org/pgsql-bugs/2007-05/msg00111.php">http://archives.postgresql.org/pgsql-bugs/2007-05/msg00111.php</a>
1317 </p>
1318   </li><li>Consider allowing 64-bit integers and floats to be passed by value on
1319   64-bit platforms
1320 <p>  Also change 32-bit floats (float4) to be passed by value at the same
1321   time.
1322 </p>
1323   </li><li>Win32
1324   <ul>
1325     <li>Remove configure.in check for link failure when cause is found
1326     </li><li>Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1327           1.4 is released
1328     </li><li>Remove psql newline patch when we find out why mingw outputs an
1329           extra newline
1330     </li><li>Allow psql to use readline once non-US code pages work with
1331           backslashes
1332     </li><li>Fix problem with shared memory on the Win32 Terminal Server
1333     </li><li>Improve signal handling
1334 <p>          <a href="http://archives.postgresql.org/pgsql-patches/2005-06/msg00027.php">http://archives.postgresql.org/pgsql-patches/2005-06/msg00027.php</a>
1335 </p>
1336   </li></ul>
1337   </li><li>Wire Protocol Changes
1338   <ul>
1339     <li>Allow dynamic character set handling
1340     </li><li>Add decoded type, length, precision
1341     </li><li>Use compression?
1342     </li><li>Update clients to use data types, typmod, schema.table.column names
1343           of result sets using new statement protocol
1344   </li></ul>
1345 </li></ul>
1346 <h1><a name="section_22">Exotic Features</a></h1>
1347
1348 <ul>
1349   <li>Add pre-parsing phase that converts non-ISO syntax to supported
1350   syntax
1351 <p>  This could allow SQL written for other databases to run without
1352   modification.
1353 </p>
1354   </li><li>Allow plug-in modules to emulate features from other databases
1355   </li><li>Add features of Oracle-style packages  (Pavel)
1356 <p>  A package would be a schema with session-local variables,
1357   public/private functions, and initialization functions.  It
1358   is also possible to implement these capabilities
1359   in any schema and not use a separate "packages"
1360   syntax at all.
1361 </p>
1362 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00384.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00384.php</a>
1363 </p>
1364   </li><li>Consider allowing control of upper/lower case folding of unquoted
1365   identifiers
1366 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2004-04/msg00818.php">http://archives.postgresql.org/pgsql-hackers/2004-04/msg00818.php</a>
1367   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg01527.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg01527.php</a>
1368 </p>
1369   </li><li>Add autonomous transactions
1370 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2008-01/msg00893.php">http://archives.postgresql.org/pgsql-hackers/2008-01/msg00893.php</a>
1371 </p>
1372 </li></ul>
1373 <h1><a name="section_23">Features We Do <u>Not</u> Want</a></h1>
1374
1375 <ul>
1376   <li>All backends running as threads in a single process (not wanted)
1377 <p>  This eliminates the process protection we get from the current setup.
1378   Thread creation is usually the same overhead as process creation on
1379   modern systems, so it seems unwise to use a pure threaded model.
1380 </p>
1381   </li><li>Optimizer hints (not wanted)
1382 <p>  Optimizer hints are used to work around problems in the optimizer.  We
1383   would rather have the problems reported and fixed.
1384 </p>
1385 <p>  <a href="http://archives.postgresql.org/pgsql-hackers/2006-08/msg00506.php">http://archives.postgresql.org/pgsql-hackers/2006-08/msg00506.php</a>
1386   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00517.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00517.php</a>
1387   <a href="http://archives.postgresql.org/pgsql-hackers/2006-10/msg00663.php">http://archives.postgresql.org/pgsql-hackers/2006-10/msg00663.php</a>
1388 </p>
1389 <p>  Because we support postfix operators, it isn't possible to make AS
1390   optional and continue to use bison.
1391   <a href="http://archives.postgresql.org/pgsql-hackers/2003-04/msg00436.php">http://archives.postgresql.org/pgsql-hackers/2003-04/msg00436.php</a>
1392 </p>
1393 <p>  <a href="http://archives.postgresql.org/pgsql-sql/2006-08/msg00164.php">http://archives.postgresql.org/pgsql-sql/2006-08/msg00164.php</a>
1394 </p>
1395   </li><li>Embedded server (not wanted)
1396 <p>  While PostgreSQL clients runs fine in limited-resource environments, the
1397   server requires multiple processes and a stable pool of resources to
1398   run reliabily and efficiently.  Stripping down the PostgreSQL server
1399   to run in the same process address space as the client application
1400   would add too much complexity and failure cases.</p>
1401 </li></ul>
1402
1403 </body>
1404 </html>