From: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
---|---|
To: | Bernd Helmle <mailings(at)oopsware(dot)de> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: psql tab completion for updatable foreign tables |
Date: | 2013-07-08 16:04:31 |
Message-ID: | CAEZATCXySgL2BQSy83K6PMEozWa+EYyJ+-LW28vN54kzEU9upw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 8 July 2013 12:46, Bernd Helmle <mailings(at)oopsware(dot)de> wrote:
> Recently i got annoyed that psql doesn't tab complete to updatable foreign
> tables.
>
> Attached is a patch to address this. I'm using the new
> pg_relation_is_updatable() function to accomplish this. The function could
> also be used for the trigger based stuff in the query, but i haven't touched
> this part of the query. The patch ist against HEAD, but maybe it's worth to
> apply this to REL9_3_STABLE, too, but not sure what our policy is at this
> state...
>
+1
A couple of points though:
* pg_relation_is_updatable is only available in 9.3, whereas psql may
connect to older servers, so it needs to guard against that.
* If we're doing this, I think we should do it for auto-updatable
views at the same time.
There was concern that pg_relation_is_updatable() would end up opening
every relation in the database, hammering performance. I now realise
that these tab-complete queries have a limit (1000 by default) so I
don't think this is such an issue. I tested it by creating 10,000
randomly named auto-updatable views on top of a table, and didn't see
any performance problems.
Here's an updated patch based on the above points.
Regards,
Dean
Attachment | Content-Type | Size |
---|---|---|
tab_complete.patch | application/octet-stream | 5.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | David E. Wheeler | 2013-07-08 16:40:29 | Re: Millisecond-precision connect_timeout for libpq |
Previous Message | Kevin Grittner | 2013-07-08 14:19:04 | Re: sepgsql and materialized views |