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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Marti Raudsepp <marti(at)juffo(dot)org>, Marcin Mańk <marcin(dot)mank(at)gmail(dot)com>, Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, Darren Duncan <darren(at)darrenduncan(dot)net>, David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date: 2011-11-01 17:33:59
Message-ID: CAFj8pRBKSQP+ThB8RovFGtv1n9GVs0F8OhEv=R_ecjrdRPaNgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/11/1 Eric Ridge <eebbrr(at)gmail(dot)com>:
> On Tue, Nov 1, 2011 at 12:24 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> some other idea - but only for psql
>>
>> we can define a special values, that ensure a some necessary
>> preexecution alchemy with entered query
>>
>> \pset star_exclude_names col1, col2, col3
>> \pset star_exclude_types xml, bytea, text(unlimited)
>>
>
> Sure, something like that could be useful too.  It might be confusing
> to users if they forget that they set an exclusion list, but there's
> probably ways to work around that.
>
> However, the nice thing about the feature being in SQL is that you can
> use it from all clients, and even in other useful ways.  COPY would be
> an example (something I also do frequently):
>
> COPY (SELECT * EXCLUDING (a, b, c) FROM <big query>) TO 'somefile.csv' WITH CSV;
>
> Right now, if you want to exclude a column, you have to list all the
> others out manually, or just dump everything and deal with it in an
> external tool.
>

sorry, I don't accept it. I am able to understand your request for
adhoc queries. But not for COPY.

and if you need it - you can write C function.

> I generally agree with everyone that says using this in application
> code is a bad idea, but I don't think that's reason alone to reject
> the idea on its face.

I can accept a PostgreSQL extensions if there are no other way how do
it effective. But it is not this case.

>
> eric
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-11-01 17:34:20 Re: unite recovery.conf and postgresql.conf
Previous Message Kohei KaiGai 2011-11-01 17:32:04 Re: [v9.2] Object access hooks with arguments support (v1)