Fix SQL generated for tables with inherited columns. Fixes #3505

This commit is contained in:
Akshay Joshi 2019-01-11 21:50:02 +05:30 committed by Dave Page
parent 8fb340d23b
commit 252e05ef29
4 changed files with 7 additions and 7 deletions

View File

@ -14,6 +14,7 @@ Features
Bug fixes
*********
| `Bug #3505 <https://redmine.postgresql.org/issues/3505>`_ - Fix SQL generated for tables with inherited columns.
| `Bug #3575 <https://redmine.postgresql.org/issues/3575>`_ - Ensure the context menu works after a server is renamed.
| `Bug #3836 <https://redmine.postgresql.org/issues/3836>`_ - Fix ordering of VACUUM options which changed in PG11.
| `Bug #3842 <https://redmine.postgresql.org/issues/3842>`_ - Don't show system catalogs in the schemas property list unless show system objects is enabled.

View File

@ -41,10 +41,10 @@ CREATE {% if data.relpersistence %}UNLOGGED {% endif %}TABLE {{conn|qtIdent(data
{### Add columns ###}
{% if data.columns and data.columns|length > 0 %}
{% for c in data.columns %}
{% if c.name and c.cltype %}
{% if loop.index != 1 %},
{% endif %}
{% if c.name and c.cltype and not c.inheritedfrom %}
{{conn|qtIdent(c.name)}} {% if is_sql %}{{c.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, c.cltype, c.attlen, c.attprecision, c.hasSqrBracket) }}{% endif %}{% if c.collspcname %} COLLATE {{c.collspcname}}{% endif %}{% if c.attnotnull %} NOT NULL{% endif %}{% if c.defval %} DEFAULT {{c.defval}}{% endif %}
{% if not loop.last %},
{% endif %}
{% endif %}
{% endfor %}
{% endif %}

View File

@ -41,10 +41,10 @@ CREATE {% if data.relpersistence %}UNLOGGED {% endif %}TABLE {{conn|qtIdent(data
{### Add columns ###}
{% if data.columns and data.columns|length > 0 %}
{% for c in data.columns %}
{% if c.name and c.cltype %}
{% if loop.index != 1 %},
{% endif %}
{% if c.name and c.cltype and not c.inheritedfrom %}
{{conn|qtIdent(c.name)}} {% if is_sql %}{{c.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, c.cltype, c.attlen, c.attprecision, c.hasSqrBracket) }}{% endif %}{% if c.collspcname %} COLLATE {{c.collspcname}}{% endif %}{% if c.attnotnull %} NOT NULL{% endif %}{% if c.defval %} DEFAULT {{c.defval}}{% endif %}
{% if not loop.last %},
{% endif %}
{% endif %}
{% endfor %}
{% endif %}