Re: Support for PostgreSQL schemas

[prev] [thread] [next] [Date index for 2005/07/13]

From: Hartmaier Alexander
Subject: Re: Support for PostgreSQL schemas
Date: 08:19 on 13 Jul 2005
This is a multi-part message in MIME format.

------=_NextPart_000_0154_01C58794.56F19670
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think you want to be able to specify which schema to use?!
If the '=3D' is changed to an 'in' you will never be sure which of the =
two
tables is chosen!
I'm using Oracle also with schemas and simply specify the schema name in
front of every table name joined with a dot.
__PACKAGE__->table'schemaname.tablename');

If you want to use the same schema name for all your tables I suggest to =
put
it into a variable (maybe read from a config file with e.g. =
Config::Simple,
I do it that way) and use the variable.
e.g.
__PACKAGE__->table(__PACKAGE__->get_config->param('schemaname') .
'.tablename');

-Alex


> -----Urspr=FCngliche Nachricht-----
> Von: Scott Cain [mailto:cain@xxxx.xxx]
> Gesendet: Mittwoch, 13. Juli 2005 04:16
> An: Jay Strauss
> Cc: cdbi-talk@xxxxxx.xxxxx.xxx
> Betreff: Re: Support for PostgreSQL schemas
>=20
> Ah, that's the thing--that's not my query, Class::DBI::Pg is issuing
> that.  I've been told that a patch has been sent to the cdbi::Pg
> author--here's hoping it goes in :-)
>=20
> On Tue, 2005-07-12 at 17:34 -0500, Jay Strauss wrote:
> > Actually that is the problem, your subselect is returning more than =
1
> > row but you are using an "=3D"
> >
> >  > indrelid=3D(
> >  > SELECT oid FROM pg_catalog.pg_class
> >  > WHERE relname =3D ?)
> >
> > make it look like:
> >
> > indrelid in (
> > SELECT oid FROM pg_catalog.pg_class
> > WHERE relname =3D ?)
> >
> > Scott Cain wrote:
> > > Hello,
> > >
> > > I am wondering if there is support for postgres schemas in cdbi?
> > > Specifically, I have a case where there are two schemas, one =
called
> > > public and one called godb.  In both of these schemas, there is a
> table
> > > called 'db', and I cannot change the name of either table.  When I
> try
> > > to use cdbi to access the db table in the public schema, I get =
this
> > > error message:
> > >
> > > 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=3Dtrue AND indrelid=3D(
> > > SELECT oid FROM pg_catalog.pg_class
> > > WHERE relname =3D ?)
> > > " with ParamValues: 1=3D'db']
> > > at /usr/lib/perl5/site_perl/5.8.5/DBIx/ContextualFetch.pm line 51.
> > > Compilation failed in require at lib/Chado/LoadDBI.pm line 5.
> > > BEGIN failed--compilation aborted at lib/Chado/LoadDBI.pm line 5.
> > > Compilation failed in require at ./load/bin/gmod_load_ontology.pl
> line
> > > 7.
> > > BEGIN failed--compilation aborted at
> ./load/bin/gmod_load_ontology.pl
> > > line 7.
> > >
> > > So it looks like DBIx::ContextualFetch is unhappy about there =
being
> two
> > > tables named 'db'.  Is there a way around this?
> > >
> > > Thanks,
> > > Scott
> > >
> > >
> --
> =
------------------------------------------------------------------------
> Scott Cain, Ph. D.                                         =
cain@xxxx.xxx
> GMOD Coordinator (http://www.gmod.org/)                     =
216-392-3087
> Cold Spring Harbor Laboratory


------=_NextPart_000_0154_01C58794.56F19670
Content-Type: application/x-pkcs7-signature;
	name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="smime.p7s"

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIISkjCCApow
ggIDoAMCAQICASQwDQYJKoZIhvcNAQEEBQAwcTELMAkGA1UEBhMCREUxHDAaBgNVBAoTE0RldXRz
Y2hlIFRlbGVrb20gQUcxHzAdBgNVBAsTFlQtVGVsZVNlYyBUcnVzdCBDZW50ZXIxIzAhBgNVBAMT
GkRldXRzY2hlIFRlbGVrb20gUm9vdCBDQSAxMB4XDTk5MDcwOTExMzQwMFoXDTE5MDcwOTIzNTkw
MFowcTELMAkGA1UEBhMCREUxHDAaBgNVBAoTE0RldXRzY2hlIFRlbGVrb20gQUcxHzAdBgNVBAsT
FlQtVGVsZVNlYyBUcnVzdCBDZW50ZX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Kfr4GVJ44HJO7GlUegSrWEzAkBgkqhkiG9w0BCQ8xFzAV
MAoGCCqGSIb3DQMHMAcGBSsOAwIaMIGRBgkrBgEEAYI3EAQxgYMwgYAwejELMAkGA1UEBhMCREUx
JTAjBgNVBAoTHFQtU3lzdGVtcyBJbnRlcm5hdGlvbmFsIEdtYkgxJTAjBgNVBAsTHFQtU3lzdGVt
cyBJbnRlcm5hdGlvbmFsIEdtYkgxHTAbBgNVBAMTFFQtU3lzdGVtcyBDb21wYW55IENBAgJHFjCB
kwYLKoZIhvcNAQkQAgsxgYOggYAwejELMAkGA1UEBhMCREUxJTAjBgNVBAoTHFQtU3lzdGVtcyBJ
bnRlcm5hdGlvbmFsIEdtYkgxJTAjBgNVBAsTHFQtU3lzdGVtcyBJbnRlcm5hdGlvbmFsIEdtYkgx
HTAbBgNVBAMTFFQtU3lzdGVtcyBDb21wYW55IENBAgJHFjANBgkqhkiG9w0BAQEFAASBgA1L90Zd
ZrLZh/1nh/61hhIJcbk3ioWTinu6nURiue37O553LKWoBPb5NwXPWWZpXUWffiAIG+e/1TQdRVMF
8cAGk+bUxmjq6mPcW1km7h6ExhLlEJ4uw8nl9WR/NntYINHSZ4deicVl1pO/81Uywd77hbh9dlCa
/y6QrvAmp2acAAAAAAAA

------=_NextPart_000_0154_01C58794.56F19670--

Support for PostgreSQL schemas
Scott Cain 19:15 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Tony Bowden 21:55 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Matt S Trout 22:15 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Jay Strauss 22:32 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Jay Strauss 22:34 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Scott Cain 02:15 on 13 Jul 2005

Re: Support for PostgreSQL schemas
Jay Strauss 22:35 on 12 Jul 2005

Re: Support for PostgreSQL schemas
Hartmaier Alexander 08:19 on 13 Jul 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52