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