This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c62b2f4  [docs] CTAS on PostgreSQL needs commit to apply (#8367)
c62b2f4 is described below

commit c62b2f434001c9d88e56d068a53cb69d044e0323
Author: Daniel Vaz Gaspar <danielvazgas...@gmail.com>
AuthorDate: Thu Oct 17 14:54:02 2019 +0100

    [docs] CTAS on PostgreSQL needs commit to apply (#8367)
    
    * [docs] New, document need for PG to use autocommit for CTAS
---
 docs/installation.rst |  3 +++
 docs/sqllab.rst       | 19 +++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/docs/installation.rst b/docs/installation.rst
index cc6792a..569277e 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -579,6 +579,9 @@ object gets unpacked into the
 while the ``metadata_params`` get unpacked into the
 `sqlalchemy.MetaData 
<https://docs.sqlalchemy.org/en/rel_1_2/core/metadata.html#sqlalchemy.schema.MetaData>`_
 call. Refer to the SQLAlchemy docs for more information.
 
+.. note:: If your using CTAS on SQLLab and PostgreSQL
+    take a look at :ref:`ref_ctas_engine_config` for specific 
``engine_params``.
+
 
 Schemas (Postgres & Redshift)
 -----------------------------
diff --git a/docs/sqllab.rst b/docs/sqllab.rst
index 9f9bac0..39ae4d4 100644
--- a/docs/sqllab.rst
+++ b/docs/sqllab.rst
@@ -122,3 +122,22 @@ database configuration:
 
 Here, "version" should be the version of your Presto cluster. Support for this
 functionality was introduced in Presto 0.319.
+
+.. _ref_ctas_engine_config:
+
+Create Table As (CTAS)
+''''''''''''''''''''''
+
+You can use ``CREATE TABLE AS SELECT ...`` statements on SQLLab. This feature 
can be toggled on
+and off at the database configuration level.
+
+Note that since ``CREATE TABLE..`` belongs to a SQL DDL category. Specifically 
on PostgreSQL, DDL is transactional,
+this means that to properly use this feature you have to set ``autocommit`` to 
true on your engine parameters:
+
+.. code-block:: json
+
+    {
+        ...
+        "engine_params": {"isolation_level":"AUTOCOMMIT"},
+        ...
+    }

Reply via email to