all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20422: 24.3; sql-connect uses local rather than remote client
@ 2015-04-24 23:44 Matthew Krauss
  2016-09-19  8:11 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Krauss @ 2015-04-24 23:44 UTC (permalink / raw)
  To: 20422

Hi!

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.

In fact, I have patched my sql.el to allow exactly this. At the bottom
of the defun SQL-CONNECT I have changed the bit that invokes
SQL-PRODUCT-INTERACTIVE to set the default directory as so:

    (eval `(let ((,param-var ',rem-params)
                 (default-directory ,(or (cadr (assoc 'default-directory (cdr connect-set)))
                                         default-directory)))
             (sql-product-interactive sql-product new-name)))

This is probably not the best, second best, or even third best way to do
this. It might be the very worst. However, it does work for me.

If someone wants to put this in Emacs, it might be ideal to allow
overriding any variable for the call.



In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-07 on lamiak, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.2 LTS

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: en_CA.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  rngalt-minimal-validation-header: t
  rngalt-display-validation-header: t
  magit-auto-revert-mode: t
  diff-auto-refine-mode: t
  global-auto-revert-mode: t
  winner-mode: t
  ido-vertical-mode: t
  desktop-save-mode: t
  nxhtml-tag-do-also: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  shell-dirtrack-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  nxhtml-menu-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> <return> C-x b <return> C-x k <return> y e 
s <return> C-x b s q l C-s C-r C-s <return> M-< M-> 
C-x k <return> C-x b y e s <return> C-x b s q l C-s 
<return> M-< M-> C-x k <return> y e s <return> C-y 
M-y M-y M-y M-y C-/ <return> C-p C-p C-p C-a M-> \ 
x SPC o n <return> M-p M-p <return> \ s x <backspace> 
<backspace> x SPC a u t o <return> M-p M-p <return> 
<select-window> <select-window> C-x o M-x r e p o r 
t - e m <tab> <return> C-g C-x b s c <return> M-x M-p 
<return>

Recent messages:
Mark set [2 times]
Process SQL<1> exited abnormally with code 129

Mark set
Undo!
Mark set
History item: 1
History item: 2
History item: 1
History item: 2
Quit

Load-path shadows:
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-loaddefs hides /home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/org-loaddefs
/home/mkrauss/.emacs.d/el-get/js2-mode/.dir-locals hides /home/mkrauss/.emacs.d/el-get/org-mode/.dir-locals
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/htmlize hides /home/mkrauss/.emacs.d/el-get/htmlize/htmlize
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/org-panel hides /home/mkrauss/.emacs.d/el-get/nxhtml/util/org-panel
/home/mkrauss/.emacs.d/el-get/php-mode/php-mode hides /home/mkrauss/.emacs.d/el-get/nxhtml/related/php-mode
/home/mkrauss/.emacs.d/el-get/js2-mode/.dir-locals hides /home/mkrauss/.emacs.d/el-get/el-get/.dir-locals
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/htmlize hides /usr/share/emacs24/site-lisp/emacs-goodies-el/htmlize
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/mkrauss/.emacs.d/el-get/prolog-el/prolog hides /usr/share/emacs/24.3/lisp/progmodes/prolog
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-mhe hides /usr/share/emacs/24.3/lisp/org/org-mhe
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-eshell hides /usr/share/emacs/24.3/lisp/org/org-eshell
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-entities hides /usr/share/emacs/24.3/lisp/org/org-entities
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-octave hides /usr/share/emacs/24.3/lisp/org/ob-octave
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-rmail hides /usr/share/emacs/24.3/lisp/org/org-rmail
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-keys hides /usr/share/emacs/24.3/lisp/org/ob-keys
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-shen hides /usr/share/emacs/24.3/lisp/org/ob-shen
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-css hides /usr/share/emacs/24.3/lisp/org/ob-css
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-docview hides /usr/share/emacs/24.3/lisp/org/org-docview
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-compat hides /usr/share/emacs/24.3/lisp/org/org-compat
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-gnuplot hides /usr/share/emacs/24.3/lisp/org/ob-gnuplot
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-ocaml hides /usr/share/emacs/24.3/lisp/org/ob-ocaml
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-java hides /usr/share/emacs/24.3/lisp/org/ob-java
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-timer hides /usr/share/emacs/24.3/lisp/org/org-timer
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-ledger hides /usr/share/emacs/24.3/lisp/org/ob-ledger
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-inlinetask hides /usr/share/emacs/24.3/lisp/org/org-inlinetask
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-footnote hides /usr/share/emacs/24.3/lisp/org/org-footnote
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-python hides /usr/share/emacs/24.3/lisp/org/ob-python
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org hides /usr/share/emacs/24.3/lisp/org/org
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-R hides /usr/share/emacs/24.3/lisp/org/ob-R
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-plot hides /usr/share/emacs/24.3/lisp/org/org-plot
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-calc hides /usr/share/emacs/24.3/lisp/org/ob-calc
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-ref hides /usr/share/emacs/24.3/lisp/org/ob-ref
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-picolisp hides /usr/share/emacs/24.3/lisp/org/ob-picolisp
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-lob hides /usr/share/emacs/24.3/lisp/org/ob-lob
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-table hides /usr/share/emacs/24.3/lisp/org/org-table
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-bibtex hides /usr/share/emacs/24.3/lisp/org/org-bibtex
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-io hides /usr/share/emacs/24.3/lisp/org/ob-io
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-clock hides /usr/share/emacs/24.3/lisp/org/org-clock
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-gnus hides /usr/share/emacs/24.3/lisp/org/org-gnus
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-js hides /usr/share/emacs/24.3/lisp/org/ob-js
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-agenda hides /usr/share/emacs/24.3/lisp/org/org-agenda
/home/mkrauss/.emacs.d/el-get/nxhtml/util/org-odt hides /usr/share/emacs/24.3/lisp/org/org-odt
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-sass hides /usr/share/emacs/24.3/lisp/org/ob-sass
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-scheme hides /usr/share/emacs/24.3/lisp/org/ob-scheme
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/org-mew hides /usr/share/emacs/24.3/lisp/org/org-mew
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-C hides /usr/share/emacs/24.3/lisp/org/ob-C
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-haskell hides /usr/share/emacs/24.3/lisp/org/ob-haskell
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-habit hides /usr/share/emacs/24.3/lisp/org/org-habit
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-src hides /usr/share/emacs/24.3/lisp/org/org-src
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-faces hides /usr/share/emacs/24.3/lisp/org/org-faces
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-perl hides /usr/share/emacs/24.3/lisp/org/ob-perl
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-feed hides /usr/share/emacs/24.3/lisp/org/org-feed
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob hides /usr/share/emacs/24.3/lisp/org/ob
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-lisp hides /usr/share/emacs/24.3/lisp/org/ob-lisp
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-indent hides /usr/share/emacs/24.3/lisp/org/org-indent
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-latex hides /usr/share/emacs/24.3/lisp/org/ob-latex
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-colview hides /usr/share/emacs/24.3/lisp/org/org-colview
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-list hides /usr/share/emacs/24.3/lisp/org/org-list
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-archive hides /usr/share/emacs/24.3/lisp/org/org-archive
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-attach hides /usr/share/emacs/24.3/lisp/org/org-attach
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-exp hides /usr/share/emacs/24.3/lisp/org/ob-exp
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-macs hides /usr/share/emacs/24.3/lisp/org/org-macs
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-lilypond hides /usr/share/emacs/24.3/lisp/org/ob-lilypond
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-scala hides /usr/share/emacs/24.3/lisp/org/ob-scala
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-w3m hides /usr/share/emacs/24.3/lisp/org/org-w3m
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-sqlite hides /usr/share/emacs/24.3/lisp/org/ob-sqlite
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-fortran hides /usr/share/emacs/24.3/lisp/org/ob-fortran
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-maxima hides /usr/share/emacs/24.3/lisp/org/ob-maxima
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/org-vm hides /usr/share/emacs/24.3/lisp/org/org-vm
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-eval hides /usr/share/emacs/24.3/lisp/org/ob-eval
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-capture hides /usr/share/emacs/24.3/lisp/org/org-capture
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-irc hides /usr/share/emacs/24.3/lisp/org/org-irc
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-dot hides /usr/share/emacs/24.3/lisp/org/ob-dot
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-crypt hides /usr/share/emacs/24.3/lisp/org/org-crypt
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-table hides /usr/share/emacs/24.3/lisp/org/ob-table
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-asymptote hides /usr/share/emacs/24.3/lisp/org/ob-asymptote
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-screen hides /usr/share/emacs/24.3/lisp/org/ob-screen
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-bbdb hides /usr/share/emacs/24.3/lisp/org/org-bbdb
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-info hides /usr/share/emacs/24.3/lisp/org/org-info
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-plantuml hides /usr/share/emacs/24.3/lisp/org/ob-plantuml
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-loaddefs hides /usr/share/emacs/24.3/lisp/org/org-loaddefs
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-pcomplete hides /usr/share/emacs/24.3/lisp/org/org-pcomplete
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-ctags hides /usr/share/emacs/24.3/lisp/org/org-ctags
/home/mkrauss/.emacs.d/el-get/org-mode/contrib/lisp/org-wl hides /usr/share/emacs/24.3/lisp/org/org-wl
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-comint hides /usr/share/emacs/24.3/lisp/org/ob-comint
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-element hides /usr/share/emacs/24.3/lisp/org/org-element
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-sql hides /usr/share/emacs/24.3/lisp/org/ob-sql
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-install hides /usr/share/emacs/24.3/lisp/org/org-install
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-id hides /usr/share/emacs/24.3/lisp/org/org-id
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-mobile hides /usr/share/emacs/24.3/lisp/org/org-mobile
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-awk hides /usr/share/emacs/24.3/lisp/org/ob-awk
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-clojure hides /usr/share/emacs/24.3/lisp/org/ob-clojure
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-ruby hides /usr/share/emacs/24.3/lisp/org/ob-ruby
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-protocol hides /usr/share/emacs/24.3/lisp/org/org-protocol
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-org hides /usr/share/emacs/24.3/lisp/org/ob-org
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-ditaa hides /usr/share/emacs/24.3/lisp/org/ob-ditaa
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-matlab hides /usr/share/emacs/24.3/lisp/org/ob-matlab
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-mouse hides /usr/share/emacs/24.3/lisp/org/org-mouse
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-datetree hides /usr/share/emacs/24.3/lisp/org/org-datetree
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-tangle hides /usr/share/emacs/24.3/lisp/org/ob-tangle
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-emacs-lisp hides /usr/share/emacs/24.3/lisp/org/ob-emacs-lisp
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/ob-mscgen hides /usr/share/emacs/24.3/lisp/org/ob-mscgen
/home/mkrauss/.emacs.d/el-get/org-mode/lisp/org-version hides /usr/share/emacs/24.3/lisp/org/org-version
/home/mkrauss/.emacs.d/el-get/js2-mode/.dir-locals hides /usr/share/emacs/24.3/lisp/gnus/.dir-locals

Features:
(shadow mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail iso-transl
sort org-attach org-id web-mode ps-mode php-mode flymake-for-el log-view
vc-cvs vc-rcs vc-dir ewoc tabify man magit-blame vc ediff-vers org-clock
vc-dispatcher vc-svn wdired whitespace gitignore-mode conf-mode linum
mail-utils network-stream starttls url-http tls mail-parse rfc2231
rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth restclient
json-reformat url url-proxy url-privacy url-history url-cookie
url-domsuf mailcap epa-file css-mode markdown-mode foldit nxml-uchnm
rng-xsd xsd-regexp rng-cmpct sgml-mode rngalt nxhtml-mumamo mumamo-fun
mumamo mumamo-chunks reposition mule-util cal-move parse-time dired-aux
find-dired js json moz imenu magit-key-mode magit view grep epa epg
epg-config diff-mode git-rebase-mode git-commit-mode log-edit pcvs-util
tramp-cmds misearch multi-isearch sh-script smie executable dabbrev
pcmpl-unix tramp-cache tramp-sh em-unix em-script em-prompt em-ls
em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias
cc-langs org-eldoc flyspell ispell org-rmail org-mhe org-irc org-info
org-gnus org-docview doc-view jka-compr image-mode org-bibtex bibtex
org-bbdb org-w3m org-element avl-tree org-mobile org-agenda org-capture
org org-macro org-footnote org-pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs find-func
cal-menu calendar cal-loaddefs ediff-merg ediff-diff ediff-wind
ediff-help ediff-util ediff-mult ediff-init ediff em-term term
disp-table ehelp electric em-smart esh-var esh-io esh-cmd esh-opt
esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode
esh-util autorevert winner lambda-mode ido-vertical-mode ido desktop
uniquify bar-cursor info color-theme wid-edit server nxhtml-mode popcmp
url-expand url-util url-methods url-parse url-vars loadhist rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok sql help-at-pt speedbar sb-image ezimage dframe flymake
add-log cc-mode cc-fonts cc-guess cc-menus cc-cmds tramp tramp-compat
auth-source eieio gnus-util mm-util mail-prsvr password-cache
tramp-loaddefs shell pcomplete format-spec ropemacs pymacs warnings
cc-styles cc-align cc-engine cc-vars cc-defs iedit rect org-loaddefs
magit-autoloads slime gud apropos etags arc-mode archive-mode noutline
outline hyperspec thingatpt browse-url slime-autoloads yasnippet derived
edmacro kmacro whattf-dt html5-langs flymake-files advice advice-preload
flymakemsg nxhtml-autostart nxhtml-autoload majmodpri vc-git nxhtml-menu
web-autoload nxhtml-base el-get el-get-autoloading el-get-list-packages
el-get-dependencies el-get-build el-get-status el-get-methods
el-get-fossil el-get-svn el-get-pacman el-get-github-zip
el-get-github-tar el-get-http-zip el-get-http-tar el-get-hg el-get-go
el-get-git-svn el-get-fink el-get-emacswiki el-get-http el-get-notify
el-get-emacsmirror el-get-github el-get-git el-get-elpa el-get-darcs
el-get-cvs el-get-bzr el-get-brew el-get-builtin el-get-apt-get
el-get-recipes el-get-byte-compile el-get-custom el-get-core .loaddefs
byte-opt compile comint ansi-color ring pp help-mode easymenu package
autoload help-fns bytecomp byte-compile cconv dired cl-macs gv cl cl-lib
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20422: 24.3; sql-connect uses local rather than remote client
  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
  2016-09-27 10:53   ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2016-09-19  8:11 UTC (permalink / raw)
  To: Matthew Krauss; +Cc: 20422

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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20422: 24.3; sql-connect uses local rather than remote client
  2016-09-19  8:11 ` Michael Albinus
@ 2016-09-27 10:53   ` Michael Albinus
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Albinus @ 2016-09-27 10:53 UTC (permalink / raw)
  To: Matthew Krauss; +Cc: 20422-done

Version: 25.1

Hi Matthew,

> 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:
>
> ** SQL mode
>
> *** New user variable 'sql-default-directory' enables remote
> connections using Tramp.
>
> Sounds like this is exactly what you have asked for. Could you, please, check?

I'm closing the bug. Feel free to reopen if it doesn't work for you.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-27 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-09-27 10:53   ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.