A script to do this should be trivial. This is just off the top of my head.
#!/usr/bin/perl
open(USER, "/etc/passwd");
while(<USER>) {
@tmp = split(/:/, $_);
$home_dir = $tmp[5];
if ($home_dir) {
open(PGCONF, "> $home_dir/.psqlrc");
print PGCONF "\\set AUTOCOMMIT 'off'\n";
close(PGCONF);
}
}
close(USER);
John Sidney-Woollett wrote:
> Adding it to $HOME/.psqlrc worked fine, but means that I need to install
> it for each user.