Skip to content
  • Deimos's avatar
    PostgreSQL: Install PL/Python, add basic function · e1e62bcf
    Deimos authored
    This installs PL/Python (specifically plpython3u), enables it in the
    database, and creates a function id36_to_id that calls the Python
    function with the same name inside the tildes.lib.id module. This will
    enable doing queries similar to this, when I have a topic's ID36 from
    the site:
    
    SELECT * FROM topics WHERE topic_id = id36_to_id('asdf');
    
    The fact that this was possible to set up without having to port the
    id36_to_id logic to a different language is blowing my mind a little.
    There are some really interesting possibilities from being able to
    import all of the Python code into the database itself.
    e1e62bcf