CYBERTEC PostgreSQL Logo

PostgreSQL Vim integration: Finally ...

09.2013 / Category: / Tags:

In one my last blogs I came up with the idea of writing some Vim script for PostgreSQL so that people can edit data fast and easily directly in Vim. The goal is to export a table directly to Vim, modify it and load it back in. This can come in handy when you want to edit a configuration table or some other small data set. Using INSERT / UPDATE / DELETE can be quite a lot of work.

Importing into Vim is basically not too much of an issue – but, exporting data back to PostgreSQL has kept me and my fellow here in office (Attila Max Ruf) pretty occupied mentally.

The weekend has finally left us with the following procedures:

The PSQLInit call will initialize the editor and provide information about where to find what and so on. Then there is PSQLCopyTable to load the data from PostgreSQL to Vim (in COPY format). Once you have edited the data you can call PSQLCopySave to pump the data back in.

Note that this will simply replace the content of the entire table.

In order to receive regular updates on important changes in PostgreSQL, subscribe to our newsletter, or follow us on Facebook or LinkedIn.

Comments are closed.

CYBERTEC Logo white
Get the newest PostgreSQL Info & Tools


    This site is protected by reCAPTCHA and the Google Privacy Policy & Terms of Service apply.

    ©
    2024
    CYBERTEC PostgreSQL International GmbH
    phone-handsetmagnifiercrosscross-circle
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram