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