Re: [HACKERS] Are we losing momentum?

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Sean Chittenden <sean(at)chittenden(dot)org>, Curt Sampson <cjs(at)cynic(dot)net>, Brent Verner <brent(at)rcfile(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Are we losing momentum?
Date: 2003-06-01 03:08:49
Message-ID: 1054436929.11968.77.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers pgsql-patches

> It would also be interesting to combine this with Rod's idea of driving
> describe-type queries by table instead of hardwired code. Imagine that
> the backend's "show foo" command first looks for "foo" as a GUC
> variable, as it does now, but upon failing to find one it looks in a
> system table for a query associated with the name "foo". If it finds
> such a query, it runs it and sends back the result. Now, not only can
> we emulate "show tables", but people can easily add application-specific
> "show whatever" commands, which seems tremendously cool.

Easy enough to accomplish for the most part. I suppose the most
difficult part is whether we support arbitrary syntax?

SHOW INDEXES ON TABLE <bleah>;
SHOW TABLES;
SHOW DATABASES;
SHOW COLUMNS FROM <table>; <-- Long form of DESCRIBE <table>

I believe all of the above is valid MySQL syntax, so we would need to be
able to work with a list of colId, rather than a single one.

This does not help with tab completion or help for the above items.
Though one could certainly argue help on available commands should come
from the backend, and psql could be taught how to read the table to
determine how to deal with tab completion.

One significant downside is that describe commands would require an
initdb when updated.

Oh, if it's the backend doing the work, the queries should probably be
functions, not free-form queries. Simply makes it easier to inject
variables into the right place. In the initial patch, psql is using a
prepared statement for this work with the side benefit that the plan is
cached. An SQL function would accomplish the same thing.

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message Ron Johnson 2003-06-01 03:14:23 Re: Slashdot: SAP and MySQL Join Forces
Previous Message Vincent Hikida 2003-06-01 01:55:29 Re: Slashdot: SAP and MySQL Join Forces

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2003-06-01 03:14:23 Re: Slashdot: SAP and MySQL Join Forces
Previous Message Vincent Hikida 2003-06-01 01:55:29 Re: Slashdot: SAP and MySQL Join Forces

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-06-01 03:52:54 Re: compile error on cvs tip
Previous Message Sean Chittenden 2003-06-01 01:43:23 Re: [HACKERS] Are we losing momentum?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-06-01 03:50:15 Re: log_min_duration_statement #2
Previous Message Sean Chittenden 2003-06-01 01:43:23 Re: [HACKERS] Are we losing momentum?