> Also, I'm not sure that many extensions would really benefit from custom > utility command, as you can already do pretty much anything you want using > SQL > functions. For instance it would be nice for hypopg to be able to support > > CREATE HYPOTHETICAL INDEX ... > > rather than > > SELECT hypopg_create_index('CREATE INDEX...') > > But really the only benefit would be autocompletion, which still wouldn't > be > possible as psql autocompletion won't be extended. And even if it somehow > was, > I wouldn't expect all psql clients to be setup as needed. >
The extending parser can be interesting for two cases a) compatibility with other databases b) experimental supports of some features standard (current or future) c) some experiments - using CREATE PIPE xxx(xxx), or CREATE HYPERCUBE xxx (xxx) is more readable more SQLish (more natural syntax) than SELECT create_pipe('name', 'a1', 'int', ...) or SELECT ext('CREATE PIPE ...) Possibility to work with a parser is one main reason for forking postgres. Lot of interestings projects fail on the cost of maintaining their own fork. Maybe a good enough possibility is the possibility to inject an own parser called before Postgres parser. Then it can do a transformation from "CREATE PIPE ..." to "SELECT extparse("CREATE PIPE()". There can be a switch if returned content is string for reparsing or already prepared AST. It can be very interesting feature. Pavel