On Friday 14 May 2010 08:22:34 am Christoph Gohle wrote:
> Hi again,
>
> some time ago I wrote about a problem in Class Designer where none but
> the public schema tables columns could be seen in ClassDesigner when
> doing an 'Add From Data Environment' operation while using a postgres
> database, version 8.1 (see below).
>
> I finally found a workaround (maybe a fix) to the postgresql database
> driver:
>
> --- dbPostgreSQL.py~  2009-04-09 00:10:54.000000000 +0200
> +++ dbPostgreSQL.py   2010-05-14 16:47:20.000000000 +0200
> @@ -164,7 +164,7 @@
>                                       " ('ctid', 'cmin', 'cmax', 'tableoid', 
> 'xmax', 'xmin')")
>               sql.append("AND has_schema_privilege(n.oid, 'usage')"
>                               " AND has_table_privilege(c.oid, 'select')"
> -                             " AND pg_table_is_visible(c.oid)"
> +#                            " AND pg_table_is_visible(c.oid)"
>                               " ORDER BY c.relname, a.attname")
>               cursor.execute(' '.join(sql))
>               fields = []
>
> Looking at the postgres documentation: pg_table_is_visible "...
> determine whether a certain object is visible in the current schema
> search path. A table is said to be visible if its containing schema is
> in the search path and no table of the same name appears earlier in
> the search path. This is equivalent to the statement that the table
> can be referenced by name without explicit schema qualification."
>
> but since no explicit search path is set in 'dbPostgreSQL.py' (I
> think), the table is never visible unless it is in ('$user', public).
> Since the driver always uses fully qualified names of the form
> schema.table (as far as I can see), 'pg_table_is_visible' is
> inappropriate here.
>
> I hope my analysis is right and it saves some headaches.
>
> Greetings,
> Christoph.

The search path is set in Postgres.  The reason I put the code in the sql was 
to prevent violations of the security and still allow schema's.  It is true 
that standard search path is $user,public but that's why Postgres uses search 
paths to allow the security to work and access to schemas other than 
just "public"..  If you feel that I'm incorrect would you be so kind to 
provide a link or doc's to support what you are suggesting.

see
http://www.postgresql.org/docs/8.1/interactive/ddl-schemas.html

On how to set search paths

Johnf




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to