All talks: https://emacsconf.org/2024/talks/
PGmacs: browsing and editing PostgreSQL databases from Emacs
https://emacsconf.org/2024/talks/pgmacs - Eric Marsden - Track: General
Watch/participate: https://emacsconf.org/2024/watch/gen/
Q&A room: https://media.emacsconf.org/2024/current/bbb-pgmacs.html
IRC: https://chat.emacsconf.org/#/connect?join=emacsconf,emacsconf-gen or #emacsconf-gen on libera.chat network
Guidelines for conduct: https://emacsconf.org/conduct
See end of file for license (CC Attribution-ShareAlike 4.0 + GPLv3 or later)
----------------------------------------------------------------
Notes, discussions, links, feedback:
- I have got 270 tables, and it stays there forever "loading" tables, and nothing appears.
- Thanks for checking it out! You may have an authentication failure, and PGmacs is not very good at showing that in the connect phase. Switch to the *Messages* buffer and see whether there's an error message there.
- This is happening with me as well. I noticed this error message in Postgres Logs. It works if I open the postgres database.
- db-1 | 2024-12-08 18:58:41.524 UTC [48] STATEMENT: CREATE EXTENSION IF NOT EXISTS vector
- db-1 | 2024-12-08 18:59:13.831 UTC [50] ERROR: could not open extension control file "/usr/share/postgresql/14/extension/vector.control": No such file or directory
- In *Messages* buffer, this is what I see
- pg-bind: Wrong type argument: stringp, 97
- OK, thanks for this feedback. It looks like your Postgres vector extension is not well set up, but that really shouldn't be causing a complete connection failure. You can comment out the line (pg-vector-setup con) in function pgmacs-open in pgmacs.el and see whether that helps
- Let me try that and report back.
- I got this error: pg-do-startup: Process postgres not running: failed with code 111
- OK, that means that the network connection failed. There is probably more error information in the backtrace
- Ah sorry, had stopped the pg. This time I got the same error
- pg-bind: Wrong type argument: stringp, 97
- But it didn't try to load vector extensions (from pg logs).
- With toggle-debug-on-error, this is the backtrace
- https://gist.github.com/ankitrgadiya/d9ae038489e4f680e3037e2e61584312
- OK, thanks for that backtrace. I don't immediately see what is wrong here. There is something strange about that shared_urls table, it seems. Are you using pg-el from the github repo?
- I created the github issue to continue the discussion: https://github.com/emarsden/pgmacs/issues/9
- BTW I'm using the postgres docker image.
- This is amazing! Image inline :o !!
- I'm impressed by the inline images. Just sprinkle a little elisp and voila.
- A PostGIS point field -> osm.el integration would be very cool
- Interesting idea, will look into that.
- <sctb> emarsden: Super slick Emacs/PG hacking and presentation! Eat your heart out, MS Access
- <NullNix> another package I never knew I needed
- <alzai> Very cool, I'm currently using PG on a small project and it's always a pain to leave emacs to do checks in the database.
- <NullNix> I just wish it had existed when I was doing massive db work in the 90s/2000s
- <gs-101> Just installed it, to prevent me from forgetting about it.
----------------------------------------------------------------
Questions and answers go here:
- Q: This is brilliant, thank you! Do you know if PGmacs works with TRAMP? I often use TRAMP multi-hop to access databases - both remotely when accessing via a 'bastion server' and locally when using OCI containers
- A: There is no TRAMP support, I'm afraid. PGmacs is directly connecting to the database server over the network. You can set up ssh tunnels, but that would be done separately from Tramp. Thanks :)
- <NullNix> you can tunnel arbitrary data over ssh
- <NullNix> ssh subsystems are the thing to look at, I think... I might look at it
- <NullNix> (sftp works that way: basically you can put arbitrary progams at the remote end... like, oh, say, pgsql. transparently to the ssher.)
- <jreicher> Possibly PGmacs could setup the tunnel itself, using TRAMP?
- With docker.el, kubel, etc, it's often possible to for example select a container/pod/whatever that is hosted on a machine you've connected to via TRAMP (such as /podman:<image>:/path/), and trigger a terminal/eshell as well as port-forwards and other similar things. It'd be nice to be able to use this tool in a similar way since it would open up the ability to use it with complex connection configurations. Doing SSH tunnels manually is ofc totally fine in practice :)
- Q: <Donovan>Great work! I'm impressed. How did you come up with this brilliant idea?
- A: First got the idea by looking at sqlite-mode
- Q: Is sqlite-mode also capable of all of this functionality (table relations, etc)? If not, will it be possible to abstract out this functionality from pgmacs somehow?
- A: I'm not veyr familiar with sqlite-mode but it looks more basic. There are differences between the sql dialects so it will be difficult to abstract it out.
- Q: Would it be possible to move it into Emacs tree? Are the maintainers interested in it?
- A: Currently its at a very early stage and is being updated regularly. I also have some philosophical reasons to not do it regarding copyright transfer to the FSF.
- Q: Almost missed this one, so glad I didn't, but this may have been answered already: what do you use for the in-buffer tables? vtable?
- A: vtable but "forked" (some changes/improvements, may consider "merging" back with vtable core work)
- Q:
----------------------------------------------------------------
Next talks:
Questions/comments related to EmacsConf 2024 as a whole? https://pad.emacsconf.org/2024
----------------------------------------------------------------
This pad will be archived at https://emacsconf.org/2024/talks/pgmacs after the conference.
Except where otherwise noted, the material on the EmacsConf pad are dual-licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International Public License; and the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) an later version. Copies of these two licenses are included in the EmacsConf wiki repository, in the COPYING.GPL and COPYING.CC-BY-SA files (https://emacsconf.org/COPYING/)
By contributing to this pad, you agree to make your contributions available under the above licenses. You are also promising that you are the author of your changes, or that you copied them from a work in the public domain or a work released under a free license that is compatible with the above two licenses. DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION.