+AD4- -----Original Message----- +AD4- From: Tom Lane +AFs-mailto:tgl+AEA-sss.pgh.pa.us+AF0- +AD4- Sent: 17 May 2002 21:26 +AD4- To: Dave Page +AD4- Cc: pgsql-hackers+AEA-postgresql.org +AD4- Subject: Re: +AFs-HACKERS+AF0- More schema queries +AD4- +AD4- +AD4- +ACI-Dave Page+ACI- +ADw-dpage+AEA-vale-housing.co.uk+AD4- writes: +AD4- +AD4- 1) All the system views are currently part of the public namespace. +AD4- +AD4- Not a problem for me, but shouldn't they be in pg+AF8-catalog? +AD4- +AD4- Say what? They +ACo-are+ACo- in pg+AF8-catalog. initdb creates nothing +AD4- in public. You'll have to take my word for it that I haven't played with pg+AF8-class - is it possible I got a snapshot that was built at precisely the wrong moment? helpdesk+AD0AIw- select +ACo- from pg+AF8-namespace+ADs- oid +AHw- nspname +AHw- nspowner +AHw- nspacl -------+--------------+-----------+-------------------- 11 +AHw- pg+AF8-catalog +AHw- 1 +AHw- +AHsAPQ-U+AH0- 99 +AHw- pg+AF8-toast +AHw- 1 +AHw- +AHsAPQB9- 2200 +AHw- public +AHw- 1 +AHw- +AHsAPQ-UC+AH0- 16563 +AHw- pg+AF8-temp+AF8-1 +AHw- 1 +AHw- 40071 +AHw- Test Schema +AHw- 1 +AHw- 48273 +AHw- flurb +AHw- 1 +AHw- 40072 +AHw- test +AHw- 1 +AHw- +AHsAPQ-UC,postgres+AD0-UC+AH0- 48276 +AHw- dave2 +AHw- 1 +AHw- 48277 +AHw- Gulp +AHw- 1 +AHw- +AHsAPQ-UC,postgres+AD0-UC+AH0- (9 rows) helpdesk+AD0AIw- select relnamespace, relname from pg+AF8-class where relname like 'pg+AF8AJQ-'+ADs- relnamespace +AHw- relname --------------+---------------------------------- 11 +AHw- pg+AF8-largeobject 11 +AHw- pg+AF8-aggregate 11 +AHw- pg+AF8-trigger 11 +AHw- pg+AF8-listener 11 +AHw- pg+AF8-namespace 11 +AHw- pg+AF8-attrdef 11 +AHw- pg+AF8-database 11 +AHw- pg+AF8-xactlock 11 +AHw- pg+AF8-description 11 +AHw- pg+AF8-group 11 +AHw- pg+AF8-proc 11 +AHw- pg+AF8-relcheck 11 +AHw- pg+AF8-rewrite 2200 +AHw- pg+AF8-user 2200 +AHw- pg+AF8-rules 2200 +AHw- pg+AF8-views 2200 +AHw- pg+AF8-tables 2200 +AHw- pg+AF8-indexes 2200 +AHw- pg+AF8-stats 2200 +AHw- pg+AF8-stat+AF8-all+AF8-tables 2200 +AHw- pg+AF8-stat+AF8-sys+AF8-tables 11 +AHw- pg+AF8-aggregate+AF8-fnoid+AF8-index 11 +AHw- pg+AF8-am+AF8-name+AF8-index 11 +AHw- pg+AF8-am+AF8-oid+AF8-index 11 +AHw- pg+AF8-amop+AF8-opc+AF8-opr+AF8-index 11 +AHw- pg+AF8-amop+AF8-opc+AF8-strategy+AF8-index 11 +AHw- pg+AF8-amproc+AF8-opc+AF8-procnum+AF8-index 11 +AHw- pg+AF8-attrdef+AF8-adrelid+AF8-adnum+AF8-index 11 +AHw- pg+AF8-attribute+AF8-relid+AF8-attnam+AF8-index 11 +AHw- pg+AF8-attribute+AF8-relid+AF8-attnum+AF8-index 11 +AHw- pg+AF8-class+AF8-oid+AF8-index 11 +AHw- pg+AF8-class+AF8-relname+AF8-nsp+AF8-index 11 +AHw- pg+AF8-database+AF8-datname+AF8-index 11 +AHw- pg+AF8-database+AF8-oid+AF8-index 11 +AHw- pg+AF8-description+AF8-o+AF8-c+AF8-o+AF8-index 11 +AHw- pg+AF8-group+AF8-name+AF8-index 11 +AHw- pg+AF8-group+AF8-sysid+AF8-index 11 +AHw- pg+AF8-index+AF8-indrelid+AF8-index 11 +AHw- pg+AF8-index+AF8-indexrelid+AF8-index 11 +AHw- pg+AF8-inherits+AF8-relid+AF8-seqno+AF8-index 11 +AHw- pg+AF8-language+AF8-name+AF8-index 11 +AHw- pg+AF8-language+AF8-oid+AF8-index 11 +AHw- pg+AF8-largeobject+AF8-loid+AF8-pn+AF8-index 11 +AHw- pg+AF8-namespace+AF8-nspname+AF8-index 11 +AHw- pg+AF8-namespace+AF8-oid+AF8-index 11 +AHw- pg+AF8-opclass+AF8-am+AF8-name+AF8-nsp+AF8-index 11 +AHw- pg+AF8-opclass+AF8-oid+AF8-index 11 +AHw- pg+AF8-operator+AF8-oid+AF8-index 11 +AHw- pg+AF8-operator+AF8-oprname+AF8-l+AF8-r+AF8-n+AF8-index 11 +AHw- pg+AF8-proc+AF8-oid+AF8-index 11 +AHw- pg+AF8-proc+AF8-proname+AF8-args+AF8-nsp+AF8-index 11 +AHw- pg+AF8-relcheck+AF8-rcrelid+AF8-index 11 +AHw- pg+AF8-rewrite+AF8-oid+AF8-index 11 +AHw- pg+AF8-rewrite+AF8-rel+AF8-rulename+AF8-index 11 +AHw- pg+AF8-shadow+AF8-usename+AF8-index 11 +AHw- pg+AF8-shadow+AF8-usesysid+AF8-index 11 +AHw- pg+AF8-statistic+AF8-relid+AF8-att+AF8-index 11 +AHw- pg+AF8-trigger+AF8-tgconstrname+AF8-index 11 +AHw- pg+AF8-trigger+AF8-tgconstrrelid+AF8-index 11 +AHw- pg+AF8-trigger+AF8-tgrelid+AF8-tgname+AF8-index 11 +AHw- pg+AF8-trigger+AF8-oid+AF8-index 11 +AHw- pg+AF8-type+AF8-oid+AF8-index 11 +AHw- pg+AF8-type+AF8-typname+AF8-nsp+AF8-index 2200 +AHw- pg+AF8-stat+AF8-user+AF8-tables 2200 +AHw- pg+AF8-statio+AF8-all+AF8-tables 2200 +AHw- pg+AF8-statio+AF8-sys+AF8-tables 2200 +AHw- pg+AF8-statio+AF8-user+AF8-tables 2200 +AHw- pg+AF8-stat+AF8-all+AF8-indexes 2200 +AHw- pg+AF8-stat+AF8-sys+AF8-indexes 99 +AHw- pg+AF8-toast+AF8-16384+AF8-index 99 +AHw- pg+AF8-toast+AF8-16384 2200 +AHw- pg+AF8-stat+AF8-user+AF8-indexes 2200 +AHw- pg+AF8-statio+AF8-all+AF8-indexes 2200 +AHw- pg+AF8-statio+AF8-sys+AF8-indexes 2200 +AHw- pg+AF8-statio+AF8-user+AF8-indexes 99 +AHw- pg+AF8-toast+AF8-1262+AF8-index 99 +AHw- pg+AF8-toast+AF8-1262 2200 +AHw- pg+AF8-statio+AF8-all+AF8-sequences 2200 +AHw- pg+AF8-statio+AF8-sys+AF8-sequences 2200 +AHw- pg+AF8-statio+AF8-user+AF8-sequences 2200 +AHw- pg+AF8-stat+AF8-activity 99 +AHw- pg+AF8-toast+AF8-16416+AF8-index 99 +AHw- pg+AF8-toast+AF8-16416 2200 +AHw- pg+AF8-stat+AF8-database 11 +AHw- pg+AF8-statistic 11 +AHw- pg+AF8-type 11 +AHw- pg+AF8-attribute 99 +AHw- pg+AF8-toast+AF8-1261+AF8-index 99 +AHw- pg+AF8-toast+AF8-1261 11 +AHw- pg+AF8-class 11 +AHw- pg+AF8-inherits 11 +AHw- pg+AF8-index 11 +AHw- pg+AF8-operator 99 +AHw- pg+AF8-toast+AF8-1255+AF8-index ... +AD4- +AD4- 2) pgAdmin needs to be able to find out the namespace +AD4- search path for +AD4- +AD4- the current connection through an SQL query - is this +AD4- possible yet or +AD4- +AD4- can/will a suitable function be written? +AD4- +AD4- Either 'show search+AF8-path' or 'select current+AF8-schemas()' might +AD4- do what you want+ADs- or perhaps not. Why do you want to know +AD4- the search path? What's the scenario in which pgAdmin +AD4- wouldn't set the search path for itself? pgAdmin works 99+ACU- of the time in pg+AF8-catalog. When it creates objects, it always specifies an absolute name (CREATE TABLE public.tablename...). However, one of the features is the ability to use the wizard, or just type in an SQL query and output the results to either a plugin exporter (such as MS Excel, ACSII file etc) or to a screen grid. If the user selects the screen grid, then some parsing of the query is done to figure out if we can generate queries to add/delete/update rows and therefore enable or disable the relevant buttons. One of the tests is to figure out if one of the base datasources in the query is a view - currently this is easy, but in 7.3 we could have a table +ACY- a view with the same name in different schemas, hence by using the path we can figure out what object we're actually using. Incidently if you're interested at the moment, you may remember that in 7.2 beta there was a problem with slow startup under Cygwin which was down to a few seconds by release... The last 2 snapshots I've run take well over a minute for postmaster startup on a P3M 1.13GHz/512Mb under little load. There is virtually no disk activity during this time. Regards, Dave. ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster