From 34246d8d25c0fc322af795a67eb44c0ede9bd983 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Sun, 27 Nov 2022 16:05:21 +0100 Subject: [PATCH] Add info about plugin db schemas --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bf88e5..3199bd5 100644 --- a/README.md +++ b/README.md @@ -568,7 +568,7 @@ Then, inside `psql` you can select a database and interact with the tables: \c btcpayservermainnet # list tables -\dt+ +\dt # list users SELECT "Id", "Email" FROM "AspNetUsers"; @@ -576,3 +576,20 @@ SELECT "Id", "Email" FROM "AspNetUsers"; # end session \q ``` + +The main BTCPay Server database tables are part of the `public` schema. +Plugins have their own schema, named after the plugin. + +By default, only the tables of the `public` schema are shown. +If you want to also see and select the plugin tables, you need to extend the search path: + +```bash +# list plugin schemas +SELECT * FROM pg_catalog.pg_namespace WHERE nspname LIKE 'BTCPayServer.%'; + +# extend search path +SET search_path TO "BTCPayServer.Plugins.MyPlugin", public; + +# table list now also shows the MyPlugin tables +\dt +```