I have a rails app that has been working successfully for months. In a few places I call directly to the database via ActiveRecord::Base.connection.execute( sql_code )
With a recent need to scale, I just added a second server for data processing. I want to run the same app but connect over the network to the other database server. That is the only difference here. All other areas of the app work--it can connect to the remote database.
Where it is breaking, is where I have rails issue a psql COPY command to import a csv file.
result = ActiveRecord::Base.connection.execute( @PGSQL_COPY_COMMAND ) # perform the copy command
This fails and says that the csv file can not be found. I have verified it is there and is readable to both the user running the rails app and the postgres user.
Am I missing something?