forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit722408b
committed
Add infrastructure to support server-version-dependent tab completion.
Up to now we've not worried about whether psql's tab completion querieswould work against prior server versions. But since we support olderserver versions in describe.c, we really ought to do so here as well.Failing to take care of this not only leads to loss of tab-completionservice when using an older server, but risks aborting a user's opentransaction when we send an incompatible query to the server.The recent changes in pg_proc.prokind are one reason to take this moreseriously now than before, and the proposed patch for completion afterSELECT needs some such capability as well.Hence, create some infrastructure to allow selection of one of severalversions of a query depending on server version. For cases where wejust need to select one of several query strings, introduce VersionedQueryand COMPLETE_WITH_VERSIONED_QUERY(). Likewise extend the SchemaQueryinfrastructure to allow versioning of those.I went ahead and fixed the prokind issues, to serve as an illustrationof how to use versioned SchemaQuery. To have some illustration ofVersionedQuery, change the support for completion of publication andsubscription names so that psql will not send sure-to-fail queries topre-v10 servers. There is much more that should be done to make tabcompletion more friendly to older servers, but this commit is mainlymeant to get the infrastructure in place, so I stopped here.Discussion:https://postgr.es/m/24314.1520190408@sss.pgh.pa.us1 parent42d7074 commit722408b
1 file changed
+330
-128
lines changed0 commit comments
Comments
(0)