unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Interacting with PostgreSQL
Date: Wed, 25 Nov 2020 10:37:28 +0000	[thread overview]
Message-ID: <87blflvi1j.fsf@passepartout.tim-landscheidt.de> (raw)
In-Reply-To: X73bJokUsLYUu1E0@protected.rcdrun.com

Jean Louis <bugs@gnu.support> wrote:

> […]

>> Also, my mind will be focussed on fixing the functions/etc.  Worst
>> case is that I miss that psql has reverted to auto-commit mode and
>> my not-yet-working trigger/query overwrites good data with garbage.

> OK, I do not know about that. And I am not using auto commit mode, did
> not know that it exists and will not switch to it.

The problem is that you do not need to consciously use auto-
commit mode, but that psql automatically reverts to it when
you rollback or commit a transaction:

| tim=> BEGIN WORK;
| BEGIN
| tim=> INSERT INTO t (ID) VALUES (1);
| INSERT 0 1
| tim=> ROLLBACK WORK;
| ROLLBACK
| tim=> INSERT INTO t (ID) VALUES (1);
| INSERT 0 1
| tim=> -- The row has been committed.

You can set the AUTOCOMMIT variable to off, but that does
not turn auto-commit off, but instead silently inserts BEGIN
statements where psql thinks they are useful; it can also
interfere with scripts that except auto-commit to be on.

> […]

> I am interested in your work.

> What do you store in the database?

> Do you interact through Emacs with it?

Yes, that was the point of my question :-).  I use Postgre-
SQL to store most data that fits a relational model and (for
a huge part) use Emacs to interact with it.  I also use a
number of Perl scripts for daily consistency checks and
other Perl/Python scripts where either the input/output will
be part of a pipeline or there is a modal UI that I do not
(yet) have the motivation to rewrite in Emacs Lisp (e. g.,
playing a podcast in the background and "afterwards" asking
the user whether the podcast should be marked as "heard" and
then update the database accordingly before archiving/delet-
ing the podcast file).

Tim




  reply	other threads:[~2020-11-25 10:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21 23:51 Interacting with PostgreSQL Tim Landscheidt
2020-11-22  1:33 ` Jean Louis
2020-11-24 23:14   ` Tim Landscheidt
2020-11-25  4:18     ` Jean Louis
2020-11-25 10:37       ` Tim Landscheidt [this message]
2020-11-25 14:25         ` Jean Louis
2020-11-25 17:08           ` Tim Landscheidt
2020-11-27  1:40             ` Jean Louis
2020-11-30  3:12               ` Tim Landscheidt
2020-11-30  9:12                 ` Jean Louis
2020-11-22 21:33 ` Marcin Borkowski
2020-11-24 20:42   ` Tim Landscheidt
2020-11-27  2:01   ` Jean Louis

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=87blflvi1j.fsf@passepartout.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=help-gnu-emacs@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.
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).