Le 09/10/2016 à 11:48, Pavel Stehule a écrit :
Looks very good for me minus the two following points:
1) I think \setfileref must return the same syntax than \set command
postgres=# \setfileref a testfile.txt
postgres=# \setfileref
a = 'testfile.txt'
postgres=# \setfileref
...
a = ^'testfile.txt'
I think it would be better to prefixed the variable value with the ^ too like in the \set report even if we know by using this command that reported variables are file references.
2) You still allow special file to be used, I understand that this is from the user responsibility but I think it could be a wise precaution.
postgres=# \setfileref b /dev/random
postgres=# insert into test (:b);
Process need to be killed using SIGTERM.
However if this last point is not critical and should be handle by the user, I think this patch is ready to be reviewed by a committer after fixing the first point.
Regards,
--
Gilles Darold
Consultant PostgreSQL
http://dalibo.com - http://dalibo.org