From f17c12c26a5cfdee9932313d0b8608894d822033 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 10 Jan 2018 04:35:15 +0000 Subject: [PATCH] lib/postgres/shell_function.sql --- lib/postgres/shell_function.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 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; -- 2.47.3