Re: generic copy options

From: Emmanuel Cecchet <manu(at)asterdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Emmanuel Cecchet <manu(at)asterdata(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Emmanuel Cecchet <Emmanuel(dot)Cecchet(at)asterdata(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: generic copy options
Date: 2009-09-17 11:55:05
Message-ID: 4AB22399.90006@asterdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>> While I understand the need for the server to still support the syntax,
>> is it necessary for newer version of psql to support the old syntax?
>>
>
> psql has MORE need to support old syntax than the backend does, because
> it's supposed to work against old servers.
>
Well, I wonder how many users just upgrade psql vs upgrade the server. I
was thinking that when users perform a database upgrade their
application often remain the same and therefore the server needs to
support the old syntax. Unless you are upgrading a machine where a bunch
of psql-based scripts are running to update various remote Postgres
instances with older versions, I would guess that it is unlikely that
someone is going to upgrade psql and keep the old instance of the server
on the same machine.
I just wonder how many users are using a single psql to manage multiple
server instances of different older versions.
> I wonder though if we couldn't simplify matters. Offhand it seems to me
> that psql doesn't need to validate the command's syntax fully. All it
> really needs to do is find the target filename and replace it with
> STDIN/STDOUT. Could we have it just treat the remainder of the line
> literally, and not worry about the details of what the options might be?
> Let the backend worry about throwing an error if they're bad.
>
As the only difference between \copy and copy seems to be the ability to
stream the file from the client, I guess that everything else should be
sent as is to the server as you suggest. I'll come with a patch for that
today.

Emmanuel

--
Emmanuel Cecchet
Aster Data Systems
Web: http://www.asterdata.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-09-17 12:05:09 Re: generic copy options
Previous Message Heikki Linnakangas 2009-09-17 11:32:59 Re: Streaming Replication patch for CommitFest 2009-09