Re: [PATCH] Make "psql -1 < file.sql" work as with "-f"
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Robert Haas <robertmhaas@gmail.com>, David Fetter <david@fetter.org>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2013-05-10T16:40:32Z
Lists: pgsql-hackers
> My first use of 9.3beta1 in development failed because of changes > introduced by this patch, specifically because of the newly introduced error > > psql: -1 is incompatible with -c and -l > > I'm not convinced this is correct. -c and -l are single-transaction > actions almost by definition. > > This particular aspect of the change wasn't really brought up in the > original thread. What was your thinking? AFAICR, the 3 lines patch I submitted did not include such a check. Comments by Robert in the source suggest that the -1 option is ignored under -c and -l. This is because the "transaction" is handled by process_file which is not called in these cases. However, if they are single transaction nevertheless, the guard may just be removed, even if the option does nothing? ISTM that option -l is readonly, it does not matter much. For -c, I'm not that sure. -- Fabien.