Обсуждение: psql code to be obducted by alien (me)
As authorized by Tom L. himself and barring any loud protests I will start a code clean-up on psql sometime within the next few days. So if you are doing something on it or plan on doing so, please let me know. Among the things on the agenda are: * Reduce function size, indentation levels, file sizes * Make use of latest libpq facilities * Take care of various TODO items, such as NULL display (perhaps the one recently submitted by me?), \copy issues, possibly more. * Allow for implementation of a more sophisticated readline TAB completion. (Not necessarily the one I recently sent in, if you can come up with a better one. I'll try to keep it general.) * Have tables vs. views show up correctly, as explained to me by Jan. * Various enhancements on HTML display. * A full bag of other ideas which will probably have to be postponed. I am also tempted to drop the use of libpq's PQprint so that it can be phased out, since I suspect hardly anyone else uses it and no one is really happy with it. One could perhaps put a big #ifdef around that code then. We'll see what happens. If this development would break your heart, please yell. Any other suggestions before I lock myself into my room are welcome. Peter -- Peter Eisentraut - peter_e@gmx.net http://yi.org/peter-e
Peter Eisentraut <peter_e@gmx.net> writes: > I am also tempted to drop the use of libpq's PQprint so that it can be > phased out, since I suspect hardly anyone else uses it and no one is > really happy with it. If you write new printing code for psql, please consider making it a separate module that could be included into libpq so other applications can use it. Another part of psql that should be made as independent as possible is the support for \copy. I recall a number of people asking in the past how they can read and write tables to files in their own apps. There's not that much code involved, but psql is such a mess that it's hard to point to a chunk of code they can borrow. BTW, something closely related to \copy that's languishing on the TODO list is the ability to load the contents of a local file into a Large Object or write the data out again. This would be the equivalent of the server-side operations lo_import and lo_export, but reading or writing a file in psql's environment instead of the backend's. Basically a wrapper around lo_read/lo_write, not much to it but it needs done... Anyway, I guess the point of all this is that psql should be not only a useful app in its own right, but a source of how-to examples and borrowable code for people making their own client apps. I think you will move it a long way in that direction just by doing cleanup, but please keep the notion in mind while you work. regards, tom lane
Happy coding... :-) > As authorized by Tom L. himself and barring any loud protests I will start > a code clean-up on psql sometime within the next few days. So if you are > doing something on it or plan on doing so, please let me know. Among the > things on the agenda are: > > * Reduce function size, indentation levels, file sizes > > * Make use of latest libpq facilities > > * Take care of various TODO items, such as NULL display (perhaps the one > recently submitted by me?), \copy issues, possibly more. > > * Allow for implementation of a more sophisticated readline TAB > completion. (Not necessarily the one I recently sent in, if you can come > up with a better one. I'll try to keep it general.) > > * Have tables vs. views show up correctly, as explained to me by Jan. > > * Various enhancements on HTML display. > > * A full bag of other ideas which will probably have to be postponed. > > I am also tempted to drop the use of libpq's PQprint so that it can be > phased out, since I suspect hardly anyone else uses it and no one is > really happy with it. One could perhaps put a big #ifdef around that code > then. We'll see what happens. If this development would break your heart, > please yell. > > Any other suggestions before I lock myself into my room are welcome. > > Peter > > -- > Peter Eisentraut - peter_e@gmx.net > http://yi.org/peter-e > > > > ************ > -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026