<p dir="auto">Getting an error when trying to duplicate a virtual dataset (feature in this PR: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1264749025" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/20309" data-hovercard-type="pull_request" data-hovercard-url="/apache/superset/pull/20309/hovercard" href="https://github.com/apache/superset/pull/20309">#20309</a>)</p>
<h4 dir="auto">How to reproduce the bug</h4>
<ol dir="auto">
<li>Visit the Datasets page</li>
<li>On the Actions column of a Virtual dataset, click the duplicate icon</li>
<li>Enter a dataset name and click "Duplicate"</li>
</ol>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Virtual dataset gets copied and created successfully</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">An error message appears and the dataset doesn't get created</p>
<h4 dir="auto">Screenshots</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10627051/187795512-ef471d5a-ee67-4064-a0dd-706b15bf1c87.png"><img width="874" alt="Superset 2022-08-31 15-10-11" src="https://user-images.githubusercontent.com/10627051/187795512-ef471d5a-ee67-4064-a0dd-706b15bf1c87.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">Environment</h3>
<p dir="auto">(please complete the following information):</p>
<ul dir="auto">
<li>browser type and version:</li>
<li>superset version: <code class="notranslate">master</code></li>
<li>python version: <code class="notranslate">python --version</code></li>
<li>node.js version: <code class="notranslate">node -v</code></li>
<li>any feature flags active:</li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<p dir="auto">A clear and concise description of what the bug is.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<ol dir="auto">
<li>Setup a postgres table with a timestamp with time zone (timstamptz) column</li>
<li>Query that column using sql editor or consume that column in a chart</li>
<li>See error</li>
</ol>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Be able to see the column</p>
<h3 dir="auto">Actual results</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="superset_1        | Traceback (most recent call last):
superset_1        |   File &quot;/app/superset/views/base.py&quot;, line 211, in wraps
superset_1        |     return f(self, *args, **kwargs)
superset_1        |   File &quot;/app/superset/utils/log.py&quot;, line 245, in wrapper
superset_1        |     value = f(*args, **kwargs)
superset_1        |   File &quot;/app/superset/views/core.py&quot;, line 2574, in sql_json
superset_1        |     command_result: CommandResult = command.run()
superset_1        |   File &quot;/app/superset/sqllab/command.py&quot;, line 104, in run
superset_1        |     raise ex
superset_1        |   File &quot;/app/superset/sqllab/command.py&quot;, line 96, in run
superset_1        |     status = self._run_sql_json_exec_from_scratch()
superset_1        |   File &quot;/app/superset/sqllab/command.py&quot;, line 138, in _run_sql_json_exec_from_scratch
superset_1        |     raise ex
superset_1        |   File &quot;/app/superset/sqllab/command.py&quot;, line 133, in _run_sql_json_exec_from_scratch
superset_1        |     return self._sql_json_executor.execute(
superset_1        |   File &quot;/app/superset/sqllab/sql_json_executer.py&quot;, line 111, in execute
superset_1        |     raise SupersetErrorsException(
superset_1        | superset.exceptions.SupersetErrorsException: [SupersetError(message=&quot;'+00'&quot;, error_type=&lt;SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'&gt;, level=&lt;ErrorLevel.ERROR: 'error'&gt;, extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]"><pre class="notranslate"><code class="notranslate">superset_1        | Traceback (most recent call last):
superset_1        |   File "/app/superset/views/base.py", line 211, in wraps
superset_1        |     return f(self, *args, **kwargs)
superset_1        |   File "/app/superset/utils/log.py", line 245, in wrapper
superset_1        |     value = f(*args, **kwargs)
superset_1        |   File "/app/superset/views/core.py", line 2574, in sql_json
superset_1        |     command_result: CommandResult = command.run()
superset_1        |   File "/app/superset/sqllab/command.py", line 104, in run
superset_1        |     raise ex
superset_1        |   File "/app/superset/sqllab/command.py", line 96, in run
superset_1        |     status = self._run_sql_json_exec_from_scratch()
superset_1        |   File "/app/superset/sqllab/command.py", line 138, in _run_sql_json_exec_from_scratch
superset_1        |     raise ex
superset_1        |   File "/app/superset/sqllab/command.py", line 133, in _run_sql_json_exec_from_scratch
superset_1        |     return self._sql_json_executor.execute(
superset_1        |   File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute
superset_1        |     raise SupersetErrorsException(
superset_1        | superset.exceptions.SupersetErrorsException: [SupersetError(message="'+00'", error_type=&lt;SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'&gt;, level=&lt;ErrorLevel.ERROR: 'error'&gt;, extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
</code></pre></div>
<h4 dir="auto">Screenshots</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/56386166/174778852-49154faa-bc43-4478-a6b4-136a2c44ca7e.png"><img width="1004" alt="Screenshot 2022-06-21 at 11 28 46" src="https://user-images.githubusercontent.com/56386166/174778852-49154faa-bc43-4478-a6b4-136a2c44ca7e.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">Environment</h3>
<p dir="auto">(please complete the following information):</p>
<ul dir="auto">
<li>browser type and version: Chrome 102</li>
<li>superset version: 1.5.1</li>
<li>python version:  3.8</li>
<li>node.js version: none</li>
<li>any feature flags active:</li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">This was not an issue in the 1.4.2.<br>
May be similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1229835233" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/19995" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/19995/hovercard" href="https://github.com/apache/superset/issues/19995">#19995</a></p>