This is a proposal for a new developer patch idea, in case someone's interested.

Keeping an eye on Stack Overflow has shown me that quite a few people
seem to get confused by pg_dump and pg_restore being command line
tools, not psql commands.

It'd be interesting if psql detected this and gave a useful error.
Ideally before they enter ; to terminate the line, since they're
probably following instructions that won't show one.

A related patch would be to have the parser detect \copy and other
psql backslash metacommands run as SQL queries on the server and
report a useful error. For \copy, it would HINT to look at their
client's manual for COPY support or user server-side COPY. For others
it'd say these are psql commands not postgres commands and only work
in the psql client.

One might argue that we don't need to pad things _this_ much for new
users. But I see users getting confused by psql metacommands vs
postgres server commands a lot. Similarly by pg_dump and pg_restore
being shell programs.

If it can be done at minimal cost to everyone else, it might be worth
it. Just an idea.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to