From: Michael Albinus <michael.albinus@gmx.de>
To: Matthew Krauss <m.d.krauss@gmail.com>
Cc: 20422@debbugs.gnu.org
Subject: bug#20422: 24.3; sql-connect uses local rather than remote client
Date: Mon, 19 Sep 2016 10:11:48 +0200 [thread overview]
Message-ID: <8760pscnqz.fsf@gmx.de> (raw)
In-Reply-To: <87pp6tm6qy.fsf@mkrauss-NAB-ThinkPad-W530.i-did-not-set--mail-host-address--so-tickle-me> (Matthew Krauss's message of "Fri, 24 Apr 2015 19:44:21 -0400")
Matthew Krauss <m.d.krauss@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.
next prev parent reply other threads:[~2016-09-19 8:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 23:44 bug#20422: 24.3; sql-connect uses local rather than remote client Matthew Krauss
2016-09-19 8:11 ` Michael Albinus [this message]
2016-09-27 10:53 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8760pscnqz.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=20422@debbugs.gnu.org \
--cc=m.d.krauss@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).