GNU bug report logs -
#20422
24.3; sql-connect uses local rather than remote client
Previous Next
Reported by: Matthew Krauss <m.d.krauss <at> gmail.com>
Date: Sat, 25 Apr 2015 00:24:01 UTC
Severity: normal
Found in version 24.3
Fixed in version 25.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 20422 <at> debbugs.gnu.org (full text, mbox):
Matthew Krauss <m.d.krauss <at> gmail.com> writes:
> Hi!
Hi Matthew,
> So I have encountered a minor problem. Not sure if this is a bug or a
> feature request...
>
> When using:
>
> M-x sql-connect
>
> to connect to a SQL server (in my case PostgreSQL but I doubt that is
> relevant) Emacs does not seem to have a way to use the correct backend
> client (e.g. psql) to match the server version.
>
> So suppose the following configuration:
>
> (setq sql-connection-alist
> '(("my-older-postgres-server"
> (sql-product 'postgres)
> (sql-user "myusername")
> (sql-password "mypassword")
> (sql-server "myserver.example.com")
> (sql-database "mydatabase"))))
>
> My local machine has, let's say, psql 9.3.6. The server has Postgres
> 8.4.14. Because these are different versions, some things will not work
> correctly. I may be able to install an older psql, but that may not work
> if I also am connecting to a different server running 9.3.6, or, say,
> 9.4.1.
>
> The obvious solution is to use the psql client on the server, which
> should match the server version. This is really easy to do, with Emacs
> and Tramp. For instance, I can open an eshell and enter:
>
> cd /myserver.example.com:
>
> Now from this buffer I can invoke sql-connect and it will run the psql
> client from the remote machine. However, this is kind of a pain to do
> every time, and embarrassing when I am trying to show off in front of my
> non-emacs-using co-workers and fail to remember this step, only to have
> weird errors showing up.
>
> Now if I could use this configuration instead:
>
> (setq sql-connection-alist
> '(("my-older-postgres-server"
> (sql-product 'postgres)
> (sql-user "myusername")
> (sql-password "mypassword")
> (sql-server "myserver.example.com")
> (sql-database "mydatabase")
> (default-directory "/myserver.example.com:"))))
>
> and have that change the working directory before connecting, that would
> be really great! Not only does it allow invoking a remote psql process,
> but it also allows changing the working directory for any other purpose
> you might want.
Well, personally I don't use sql.el, so I cannot say too much
about. However, the just released Emacs 25.1 says in etc/NEWS:
--8<---------------cut here---------------start------------->8---
** SQL mode
*** New user variable 'sql-default-directory' enables remote
connections using Tramp.
--8<---------------cut here---------------end--------------->8---
Sounds like this is exactly what you have asked for. Could you, please, check?
Best regards, Michael.
This bug report was last modified 8 years and 235 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.