Re: DB_pgsql and schemas
| From: | Justin Patrin | Date: | Sat, 07 Aug 2004 20:16:17 +0000 |
| Subject: | Re: DB_pgsql and schemas | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32508@lists.php.net to get a copy of this message | ||
On Sat, 07 Aug 2004 19:10:27 +0200, Olivier Guilyardi <ml@xung.org> wrote:
> Hi,
>
> At first I tried to use the DataObject Auto Builder against my postgresql
> database : it failed complaining about some non-existent relation.
>
> My database uses schemas and the error shortly describe above was coming
> from the DB::getListOf('tables') call performed by DataObject_Generator.
>
> Briefly, it was trying to get informations about table 'bar' while this
> belongs to the 'foo' schema, and thus can only be accessed with
> 'foo.bar', if no schema search path is set up (my case).
>
> Attached to this mail is a patch against DB 1.6.5 that fixes DB/pgsql.php
> for this issue :
> it modifies the getSpecialQuery() method, so that it returns a query that
> fetches fully qualified table names (as 'schema.table'). For those tables
> whose schema is 'public' (the default schema), the table names are
> retrieved without any schema prefix.
>
> Using this modified DB_pgsql class, Dataobject_Generator ran smoothly and
> created the dozen or so objects needed for my database. It's not thoroughly
> tested though, it works for me and my 7.4.2 Postgresql server. Additionally,
> the patch does not address this issue for functions and views, which belong
> to a schema as well.
>
You should submit this as a bug report:
http://pear.php.net/bugs/search.php?direction=ASC&cmd=display&status=Open&package_name[0]=DB
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--