Better psql tab-completion support for schemas and tables

Поиск
Список
Период
Сортировка
Искать

Better psql tab-completion support for schemas and tables

От:
Greg Sabino Mullane <greg@turnstep.com>
Дата:
Вложения:
(oops, this time with -c, thanks Alvaro)

Full support for all schema and table name combinations when 
getting a list of attributes. All of the following will now work:

select * from information_schema.columns where 
select * from foo where 
select * from "user" where 
select * from "foo" where 
select * from "Uppercase".lower where 
select * from "gtsm.com"."foo.Bar" where 
select * from "GTSM.com".foo where 

Also applies to other places that get lists of columns: insert into,
alter table, create index, etc.

--
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200710211532
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Re: Better psql tab-completion support for schemas and tables

От:
Bruce Momjian <bruce@momjian.us>
Дата:

This has been saved for the 8.4 release:

	http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Greg Sabino Mullane wrote:
> (oops, this time with -c, thanks Alvaro)
> 
> Full support for all schema and table name combinations when 
> getting a list of attributes. All of the following will now work:
> 
> select * from information_schema.columns where 
> select * from foo where 
> select * from "user" where 
> select * from "foo" where 
> select * from "Uppercase".lower where 
> select * from "gtsm.com"."foo.Bar" where 
> select * from "GTSM.com".foo where 
> 
> Also applies to other places that get lists of columns: insert into,
> alter table, create index, etc.
> 
> --
> Greg Sabino Mullane greg@turnstep.com
> PGP Key: 0x14964AC8 200710211532
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: Better psql tab-completion support for schemas and tables

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Greg Sabino Mullane  writes:
> Full support for all schema and table name combinations when 
> getting a list of attributes. All of the following will now work:

> select * from information_schema.columns where 
> select * from foo where 
> select * from "user" where 
> select * from "foo" where 
> select * from "Uppercase".lower where 
> select * from "gtsm.com"."foo.Bar" where 
> select * from "GTSM.com".foo where 

Applied with minor revisions.  I noticed while testing this that
although you fixed it for the case of the user having unnecessarily
quoted the preceding name, for example given a table foo,

	update "foo" set 

it's still not bright about letting you complete such an entry in the
first place -- try

	update "f

That doesn't invalidate this patch, but there's still more work to do
on the completion queries.

			regards, tom lane
FAQ