title: PostgreSQL Error - psql: fe_sendauth: no password supplied
body: <p>I have PostgreSQL setup in AWS RDS with database name as <code>some_files</code>.<BR>
  Username of DB is <code>mobileuser</code>. It has been given superuser privileges <BR></p>
  
  <p>I want to copy csv file in table called <code>data_table</code> on daily basis. So, I wrote a python script (using psycopg2) which would connect to this database and copy it.
  I tried using <code>COPY</code> command. But received an error</p>
  
  <p><code>COPY mobile user.data_table FROM 'csv_location';</code> </p>
  
  <p>It gave me error that I need to be superuser to perform this action. According to <a href="https://forums.aws.amazon.com/thread.jspa?threadID=141798" rel="nofollow noreferrer">https://forums.aws.amazon.com/thread.jspa?threadID=141798</a></p>
  
  <p><code>RDS is a managed service and in order to prevent situations that compromise that service, localhost access is not permitted. The Postgres "COPY" command causes the server itself to read/write files -- potentially directly on the Postgres host. Therefore it is restricted.
  An alternative is to use the client based, psql instruction "\copy". Documentation for that command can be found in the Postgres online manual.</code></p>
  
  <p>So I tried using <code>\copy</code> command using <code>psql</code></p>
  
  <pre><code>terminal_command = "psql -h rds_hostname -U mobileuser -w -d some_files -c \copy "+schema_name+"."+table_name+" FROM 'csv_location' DELIMITER '|' CSV HEADER"
  subprocess.call(terminal_command,shell=True)
  </code></pre>
  
  <p>I added .pgpass file to my home directory
  <code>*:*:*:*:my_password</code> with permissions as <code>600</code></p>
  
  <p>Still, it gives me error <code>psql: fe_sendauth: no password supplied</code>
  I am running python script using <code>root</code> user</p>