OSDN Git Service

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