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: Mon, 30 Nov 2020 03:12:44 +0000	[thread overview]
Message-ID: <87y2ij8rmb.fsf@passepartout.tim-landscheidt.de> (raw)
In-Reply-To: X8BZCIFBaEnST1L8@protected.rcdrun.com

Jean Louis <bugs@gnu.support> wrote:

>> >> 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.

>> > I understand. I always used it manually and will rather continue. Just
>> > observing how you do it.

>> Eh, that /is/ the behaviour using it manually, either on the
>> command line or via sql-postgres.

> I understand what you mean. Without BEGIN I am in autocommit
> mode. That is standard. But why is it problem for you?

Because if I make a mistake in auto-commit mode, potentially
all data can be changed or lost.  Therefore I want to use a
transaction wherever possible so that I can verify the ef-
fects of a query before committing it.

> […]

>> There are org-mode, many markdown variants, plain HTML, and
>> apparently even a dedicated GNU project called Hyperbole
>> (https://www.gnu.org/software/hyperbole/).

> Definitely yes. But those you mentioned are related only by
> having hyperlink features. Org mode is outline mode, markdown is not
> quite outline neither hierarchical, it is pre-processor for HTML. GNU
> Hyperbole I am using daily and started using it back in time, maybe 2
> decades with pauses and never fully used all of the options it
> has. Maybe you mean Koutliner in GNU Hyperbole as that is outline
> somewhat similar to Org but better structured.

> Emacs HyperScope is dynamic knowledge repository that augments
> knowledge, relates it together and serves as dynamic knowledge
> repository that follows the technology template project for open
> hyperdocument systems by Doug Engelbart, definitely similar in its
> nature to first Javascript based HyperScope. This one is for Emacs.

> About Dynamic Knowledge Repositories (DKR)
> https://www.dougengelbart.org/content/view/190/163/

> TECHNOLOGY TEMPLATE PROJECT OHS Framework
> https://www.dougengelbart.org/content/view/110/460/

I know.  So why use that and not Org mode?

>> There are a my- riad of version control systems, with Git at the
>> forefront.  Most of them are natively supported by Emacs, right out
>> of the box.

> That is right. And I need to think about such. For example I would
> need to check in, check out, and I do that for the files.

> When editing database entries, those are not files on file
> system. Data comes from the database. That data is itself stored in
> some files that PostgreSQL database manages is irrelevant as user has
> no access to source files normally, neither is allowed to do some
> versioning with such. Interaction goes over TCP or sockets and not
> from file access. In that sense when I am editing for example Org
> based data it is not file from file system but Org mode formatted data
> then there is currently none known versioning system that I know that
> is generic for databases.

> This can be easily helped with simple procedure that function that is
> about to edit the data simply fetch the edited data and stores it in
> the version control table before any editing. Version control table
> remembers the table, column ID, column, type and value. Right now I am
> storing those as text, but not numbers as it need some type casting to
> text that I can implement later. Major problem is with larger text
> that requires sometimes longer editing.

> Because such editing is without files I would like to know if I could
> temporarily assign a disconnected file to buffer so that file get
> saved from buffer, but when I finish recursive editing that
> buffer-string gets returned to my function that stores it into
> database. That is yet unsolved problem and could be solution to safety
> of data being edited longer time.

> Two safety problems are with PostgreSQL data entry editing, one is to
> save the previouse entries or historical and that I have solved in
> very simple manner. Other problem is to solve the currently edited
> text that is nowhere saved. For that reason I wish to find way to
> automatically save the buffers somewhere but not that buffer is
> connected to the file being saved.

> Does anybody have pointers how to do that?

> […]

I have absolutely no idea /why/ someone would store Org mode
data in a database and then wonder how to implement a form
of version control for it.  Emacs is very good at editing
files, Git is very good at versioning them, it has plenty of
commands to create branches and worktrees and everything
else one of the millions of projects using it has ever need-
ed, and Emacs Lisp is more than versatile enough to code
every imaginable workflow.

Some of the brightest minds have worked on them extensively,
either from a formally educated perspective or with the ex-
perience of blood and tears.  These giants are inviting
everybody to stand on their shoulders, and neither would I
ignore them nor would I recommend others to do so.

Tim




  reply	other threads:[~2020-11-30  3:12 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
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 [this message]
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=87y2ij8rmb.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).