Show tablespace on partitions. Fixes #2551

This commit is contained in:
Harshal Dhumal 2017-07-17 09:50:18 +01:00 committed by Dave Page
parent 4eefc52748
commit 07aa74eaf5
2 changed files with 26 additions and 19 deletions

View File

@ -19,9 +19,15 @@ CREATE {% if data.relpersistence %}UNLOGGED {% endif %}TABLE {{conn|qtIdent(data
{% endif %}
{{ data.partition_value }}{% if data.is_partitioned is defined and data.is_partitioned %}
PARTITION BY {{ data.partition_scheme }}{% endif %};
PARTITION BY {{ data.partition_scheme }}{% endif %}
{### SQL for Tablespace ###}
{% if data.spcname %}
TABLESPACE {{ conn|qtIdent(data.spcname) }};
{% else %}
;
{% endif %}
{### Alter SQL for Owner ###}
{% if data.relowner %}

View File

@ -1030,6 +1030,7 @@ class BaseTableView(PGChildNodeView):
if not status:
return internal_server_error(errormsg=rset)
if len(rset['rows']):
sql_header = u"\n-- Partitions SQL"
partition_sql = ''
for row in rset['rows']: