Re: CDBI::Pg primary key lookup
[prev]
[thread]
[next]
[Date index for 2004/06/29]
On Tue, Jun 29, 2004 at 01:30:29PM +0100, Stephen Quinney wrote:
> I am having a bit of a problem with CDBI::Pg when it attempts to look
> up the primary key for one of my tables.
>
> The error I am getting is:
>
> DBD::Pg::st execute failed: ERROR: more than one row returned by a subquery used as an expression [for Statement "SELECT indkey FROM pg_catalog.pg_index
> WHERE indisprimary=true AND indrelid=(
> SELECT oid FROM pg_catalog.pg_class
> WHERE relname = ?)
> "] at /usr/share/perl5/DBIx/ContextualFetch.pm line 51.
> Compilation failed in require.
> BEGIN failed--compilation aborted.
Well, to answer my own problem, it seems there is a standard
PostgreSQL view called 'domains' which is confusing CDBI::Pg, this is
why I end up with two OIDs. The simple solution, the one I've used, is
to rename the table, I don't know if there is a better way to avoid
CDBI::Pg picking up system tables and views with clashing names.
Stephen
|
|
Re: CDBI::Pg primary key lookup
Stephen Quinney 17:37 on 29 Jun 2004
|