emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] ob-sql should escape the password [9.7.3 (9.7.3-2f1844 @ /home/andrea/.emacs.d/elpa/org-9.7.3/)]
@ 2024-06-06 22:58 Andrea
  2024-06-07  0:20 ` Phil
  2024-06-08 15:21 ` Ihor Radchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Andrea @ 2024-06-06 22:58 UTC (permalink / raw)
  To: emacs-orgmode

Hello there, thanks for Org Mode!

ob-sql.el has a function org-babel-execute:sql. This function extracts
the password to connect to your database of choice as dbpassword.
It then uses it like this:

    (if dbpassword
	(format "PGPASSWORD=%s " dbpassword)
      "")

If the password contains an & character, the execution of a block fails.
I solved like this:
    (if dbpassword
        (format "PGPASSWORD='%s' " dbpassword)
      "")

Hope this is of help,

Andrea


Emacs  : GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
 of 2024-03-26, modified by Debian
Package: Org mode version 9.7.3 (9.7.3-2f1844 @ /home/andrea/.emacs.d/elpa/org-9.7.3/)


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

end of thread, other threads:[~2024-06-08 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 22:58 [BUG] ob-sql should escape the password [9.7.3 (9.7.3-2f1844 @ /home/andrea/.emacs.d/elpa/org-9.7.3/)] Andrea
2024-06-07  0:20 ` Phil
2024-06-08 15:21 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).