Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Дата
Msg-id 20111101221740.GC21872@rice.edu
обсуждение исходный текст
Ответ на Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Mon, Oct 31, 2011 at 09:14:48AM -0400, Andrew Dunstan wrote:
> The fact is that if you have 100 columns and want 95 of them, it's
> very tedious to have to specify them all, especially for ad hoc
> queries where the house SQL standards really don't matter that much.
> It's made more tedious by the fact that there is no real help in
> constructing the query. This gets particularly bad with views, which
> developers often seem to stuff with every available column that
> might be needed by some query instead of creating views tailored to
> particular queries. Not long ago annoyance with this prompted my to
> write a little utility function that would give me a query with all
> the columns specified  so I could cut and paste it, and delete the
> columns I didn't want. (Another advantage is that the result is
> guaranteed typo free, which my typing certainly is not.) See
> <https://gist.github.com/818490>. It's far from perfect, but I still
> find myself using it several times a month, mainly for the very
> purpose intended by this suggested feature.
> 

As I do the ad hoc query thing more than I'd like to admit,  I think
there's a place for some form of negation for *. A workaround similar to
what you describe here would be to add special tab completion to psql
that would expand * to the full list (probably on double tab ...)

Ross
-- 
Ross Reedstrom, Ph.D.                                 reedstrm@rice.edu
Systems Engineer & Admin, Research Scientist        phone: 713-348-6166
Connexions                  http://cnx.org            fax: 713-348-3665
Rice University MS-375, Houston, TX 77005
GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E  F888 D3AE 810E 88F0 BEDE


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: IDLE in transaction introspection
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?