Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Fix the comment on inherited column
Browse files Browse the repository at this point in the history
The comment was wrong because it gets the child table name, and not the parent
table name. The patch fixes this.

Unfortunately, this patch still doesn't fix comments for multi-inherited table.

Fixes #277.
  • Loading branch information
gleu committed Nov 11, 2010
1 parent f3daaf8 commit 96ac267
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Changes

Date Dev Ver Change details
---------- --- ------ --------------
2010-11-12 GL 1.12.2 Fix comment on inherited columns.
2010-11-03 GL 1.12.2 Fix frmOptions vertical size.
2010-10-28 GL 1.12.2 Select old values when connecting to another server.
2010-10-21 GL 1.12.2 Fix a lot of issues with length and precision in the
Expand Down
2 changes: 1 addition & 1 deletion pgadmin/dlg/dlgTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ wxString dlgTable::GetSql()
for (i=0 ; i < lbTables->GetCount() ; i++)
{
if (i)
sql += wxT(" ");
sql += wxT(", ");
sql += lbTables->GetString(i);
}
sql += wxT(")");
Expand Down
5 changes: 3 additions & 2 deletions pgadmin/schema/pgColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ pgObject *pgColumnFactory::CreateObjects(pgCollection *coll, ctlTree *browser, c
wxT(" ty.typstorage AS defaultstorage, cl.relname, na.nspname, att.attstattarget, description, cs.relname AS sername, ns.nspname AS serschema,\n")
wxT(" (SELECT count(1) FROM pg_type t2 WHERE t2.typname=ty.typname) > 1 AS isdup, indkey,\n")
wxT(" CASE \n")
wxT(" WHEN EXISTS( SELECT inhparent FROM pg_inherits WHERE inhrelid=att.attrelid )\n")
wxT(" THEN att.attrelid::regclass\n")
wxT(" WHEN inh.inhparent IS NOT NULL AND att.attinhcount>0\n")
wxT(" THEN inh.inhparent::regclass\n")
wxT(" ELSE NULL\n")
wxT(" END AS inhrelname");

Expand All @@ -427,6 +427,7 @@ pgObject *pgColumnFactory::CreateObjects(pgCollection *coll, ctlTree *browser, c
wxT(" JOIN pg_namespace tn ON tn.oid=ty.typnamespace\n")
wxT(" JOIN pg_class cl ON cl.oid=att.attrelid\n")
wxT(" JOIN pg_namespace na ON na.oid=cl.relnamespace\n")
wxT(" LEFT OUTER JOIN pg_inherits inh ON inh.inhrelid=att.attrelid\n")
wxT(" LEFT OUTER JOIN pg_type et ON et.oid=ty.typelem\n")
wxT(" LEFT OUTER JOIN pg_attrdef def ON adrelid=att.attrelid AND adnum=att.attnum\n")
wxT(" LEFT OUTER JOIN pg_description des ON des.objoid=att.attrelid AND des.objsubid=att.attnum\n")
Expand Down

0 comments on commit 96ac267

Please sign in to comment.