Re: Re: Connection.setCatalog()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Barry Lind <blind(at)xythos(dot)com>
Cc: jason(at)netspade(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Re: Connection.setCatalog()
Date: 2001-07-23 21:31:05
Message-ID: 200107232131.f6NLV5V21525@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


I am just seeing this message now. Does this patch need to be backed out?

>
> I don't like this patch. Nothing wrong with the code, but with what is
> being done. I wouldn't expect the setCatalog method to end my current
> transaction and quietly reconect me to another database. In this new
> connection my auto comit status will be reset and there could be other
> side effects I haven't yet thought of. What happens if the current user
> doesn't have permission to connect to the new database?
>
> Also are there any security issues with having a client being able to
> discover all databases and then going and listing all tables/objects in
> them?
>
> If we can't come up with a secure way of querying this information
> without reconnecting the connection, then I think we should not
> implement setCatalog.
>
> BTW Does anyone know what the Oracle driver does with catalogs, since
> they also don't have such a concept natively. I am especially
> interested in if they support Connection.setCatalog().
> --Barry
>
> jason(at)netspade(dot)com wrote:
>
> > Date: Thu, 19 Jul 2001 14:48:45 -0500
> > From: jason(at)netspade(dot)com
> > To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>
> > Subject: Re: Connection.setCatalog()
> >
> > [[[ Original Message from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> ]]]
> >
> >> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> >> > Tom Lane writes:
> >> >> Peter E. has previously commented that Postgres databases correspond
> >> >> most closely to the SQL concept of "catalog cluster", not "catalog".
> >>
> >> > I most certainly did not. According to my interpretation:
> >>
> >> I sit corrected. If you want to define catalog == database, okay with
> >> me.
> >>
> >> regards, tom lane
> >
> > Great, here is a context diff of CVS for implementing the
> > get/setCatalog methods in Connection - note: I've updated
> > setCatalog(String catalog) from my previous diff so it checks whether
> > it is already connected to the specified catalog.
> >
> > Thanks,
> >
> > Jason Davies
> >
> > jason(at)netspade(dot)com
> > [Connection.diff]
> > [attachment omitted]
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2001-07-23 21:39:24 Re: [PATCHES] Merging JDBC1 and JDBC2 similarities
Previous Message Dave Cramer 2001-07-23 16:20:46 RE: Help! Driver cannot be loaded.