On Feb 12, 2008 9:12 PM, Peter Gagarinov <[EMAIL PROTECTED]> wrote: > > 1) create a simple table with two columns : > > create test_table(a integer, b integer); > > 2) go to 'New Table.." menu, type in some table name, > > 3) go to 'Columns' tab, type some column name, 'a' for instance and try > to find type 'test_table' in the drop-down 'Data Type' list. > > You should see only test_table[], not test_table which doesn't seem correct.
I *think* the original intent was to not show table types at all, which probably got broken when array types were re-jigged for 8.3 - however, I don't see why we wouldn't want to see them as they are perfectly valid to use. The attached patch fixes this for me - can I get one or two of the other hackers to test this and confirm that a) I got the logic right in the change to the query and b) there is no good reason not to show the table types (Magnus, Guillaume :-))? Cheers, Dave -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com The Oracle-compatible database company
Index: pgadmin/schema/pgDatatype.cpp =================================================================== --- pgadmin/schema/pgDatatype.cpp (revision 7073) +++ pgadmin/schema/pgDatatype.cpp (working copy) @@ -164,7 +164,7 @@ else condition += wxT("IN ('b', 'c', 'e')"); - condition += wxT("AND typname NOT IN (SELECT relname FROM pg_class WHERE relnamespace = typnamespace AND relkind != 'c') "); + condition += wxT("AND typname NOT IN (SELECT relname FROM pg_class c, pg_namespace n WHERE c.relnamespace = n.oid AND (nspname = 'pg_catalog' OR nspname = 'information_schema' OR (relkind != 'c' AND relkind != 'r'))) "); if (!settings->GetShowSystemObjects()) condition += wxT(" AND nsp.nspname NOT LIKE 'information_schema'");
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq