From: Nicolas Boisselier Date: Wed, 10 Jan 2018 04:35:15 +0000 (+0000) Subject: lib/postgres/shell_function.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=f17c12c26a5cfdee9932313d0b8608894d822033;p=nb.git lib/postgres/shell_function.sql --- diff --git a/lib/postgres/shell_function.sql b/lib/postgres/shell_function.sql new file mode 100644 index 00000000..cb86b66b --- /dev/null +++ b/lib/postgres/shell_function.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS shell_function; +CREATE TABLE shell_function ( + name VARCHAR(255) PRIMARY KEY, + code TEXT +); +BEGIN TRANSACTION; +DELETE FROM shell_function; +COPY shell_function FROM PROGRAM '\ +bash -norc -c ". $NB_ROOT/etc/profile --nb-no-repos && shell_functions_csv" +' WITH (format 'text', NULL ''); +COMMIT;