emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andrea <andrea-dev@hotmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] ob-sql should escape the password [9.7.3 (9.7.3-2f1844 @ /home/andrea/.emacs.d/elpa/org-9.7.3/)]
Date: Thu, 06 Jun 2024 23:58:51 +0100	[thread overview]
Message-ID: <DU2P193MB24225F623DBF8B3D254D3C0E88FA2@DU2P193MB2422.EURP193.PROD.OUTLOOK.COM> (raw)

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/)


             reply	other threads:[~2024-06-06 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 22:58 Andrea [this message]
2024-06-07  0:20 ` [BUG] ob-sql should escape the password [9.7.3 (9.7.3-2f1844 @ /home/andrea/.emacs.d/elpa/org-9.7.3/)] Phil
2024-06-08 15:21 ` Ihor Radchenko

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DU2P193MB24225F623DBF8B3D254D3C0E88FA2@DU2P193MB2422.EURP193.PROD.OUTLOOK.COM \
    --to=andrea-dev@hotmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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/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).