289 reputation
1313
bio website basetable.wordpress.com
location Edinburgh, United Kingdom
age 25
visits member for 3 years, 7 months
seen Apr 12 at 19:27

Education is learning what you didn't even know you didn't know. - Daniel J Boorstin

On my day job I maintain a large database application for a growing Edinburgh-based travel search company. Every day I learn more about development and administration in the trenches, including how to cope with legacy worst practices and how to benefit from SQL Server best practices.

Studying part-time at Dundee University for an MSc in Business Intelligence.


Oct
9
revised How to restore Linode to Vagrant VM?
Add backup and restore tags.
Oct
9
asked How to restore Linode to Vagrant VM?
Sep
30
accepted Why doesn't sudo know where psql is?
Sep
26
comment Why doesn't sudo know where psql is?
@krowe Here that produces the message: User postgres is not allowed to run sudo on <hostname>..
Sep
26
comment Why doesn't sudo know where psql is?
@krowe I think you did mean -u. Unfortunately, it doesn't work here. From man sudo: "The -u (user) option causes sudo to run the specified command as a user other than root. [...] Security policies may restrict uids to those listed in the password database. The sudoers policy allows uids that are not in the password database as long as the targetpw option is not set. Other security policies may not support this."
Sep
26
comment Why doesn't sudo know where psql is?
@krowe sudo: the `-U' option may only be used with the `-l' option. From man sudo: "The -U (other user) option is used in conjunction with the -l option to specify the user whose privileges should be listed. The security policy may restrict listing other users’ privileges. The sudoers policy only allows root or a user with the ALL privilege on the current host to use this option."
Sep
26
comment Why doesn't sudo know where psql is?
This works, but I need a one-liner. As a one-liner this becomes sudo su postgres --command="psql -l", which works, but doesn't solve the fundamental problem. Thanks for the tip all the same!
Sep
26
comment Why doesn't sudo know where psql is?
@DrewKhoury Awesome. Your second link had the answer. I used it to write my own answer. Thanks!
Sep
26
answered Why doesn't sudo know where psql is?
Sep
26
comment Why doesn't sudo know where psql is?
@krowe /usr/pgsql-9.2/bin (no trailing slash) is in my path, but sudo -E -u postgres psql -l produces the same error: sudo: psql: command not found.
Sep
26
revised Why doesn't sudo know where psql is?
Add sudo tag.
Sep
26
asked Why doesn't sudo know where psql is?
Aug
14
awarded  Popular Question
Aug
7
awarded  Popular Question
Jun
12
awarded  Popular Question
Jan
8
awarded  Famous Question
Nov
3
asked How do I run Windows Server Backup?
Nov
3
answered How do I run Windows Server Backup?
Sep
30
comment How to detect robocopy's failure to delete from source?
Thanks, John. If we were to continue using Robocopy, we would process the logs. We thought about the effort involved in implementing a log-processing solution versus simplifying our system architecture. In the end we mapped the network storage as a local drive so that we use only SQL Server's built-in functionality. We already have log-processing solutions for SQL Server, so we have reduced the risk of missing something.
Sep
30
accepted How to detect robocopy's failure to delete from source?