Hullo all, I've written a shell script that sends a line of insert sql to a postgresql database - or it's supposed to. If the script is run on the same host as the database, there is no problem. However, I want the sql to be sent and inserted from a client running ubuntu, to a debian server, without having to install the entire postgres package on the former. I read about postgresql-client-common being the tool for the job, duly installed it, but when it ran the sql "psql -h hostname -U username dbname < filename" it grumbled "Error: You must install at least one postgresql-client-<version> package". After googling some, I then tried sticking a default cluster in /etc/postgresql-common/user_clusters on the ubuntu client: "jenny jenny 8.3 CWMain dbname" but it seems to be looking at itself, rather than the host specified on the sql line: "Error: /etc/postgresql-common/user_clusters line 24: version 8.3 does not exist" The postgres version on the server is 8.3. Is there a different approach I can take - I feel I'm missing something incredibly obvious? I've always had postgresql installed on clients in the past and haven't come across this. Many thanks, Jenny
On 27 October 2010 22:10, Jenny Hopkins <hopkins.jenny@gmail.com> wrote:
Hullo all,
I've written a shell script that sends a line of insert sql to a postgresql database - or it's supposed to. If the script is run on the same host as the database, there is no problem. However, I want the sql to be sent and inserted from a client running ubuntu, to a debian server, without having to install the entire postgres package on the former.
I read about postgresql-client-common being the tool for the job, duly installed it, but when it ran the sql "psql -h hostname -U username dbname < filename" it grumbled "Error: You must install at least one postgresql-client-<version> package".
After googling some, I then tried sticking a default cluster in /etc/postgresql-common/user_clusters on the ubuntu client: "jenny jenny 8.3 CWMain dbname" but it seems to be looking at itself, rather than the host specified on the sql line: "Error: /etc/postgresql-common/user_clusters line 24: version 8.3 does not exist"
The postgres version on the server is 8.3.
Is there a different approach I can take - I feel I'm missing something incredibly obvious? I've always had postgresql installed on clients in the past and haven't come across this.
Aha! postgresql-client-8.3 is apparently the tool for the job (or in this version of ubuntu's case -8.4). Get rid of the unrequired user_clusters file - red herring there - and all is well. So this had a helpful meaning then: "Error: You must install at least one postgresql-client-<version> package". ;-) Goodness knows what I thought it was on about. Thanks, Noodles. Jenny
participants (1)
-
Jenny Hopkins