Thread: [jason@netspade.com: DatabaseMetaData.java.diff]

[jason@netspade.com: DatabaseMetaData.java.diff]

From
Jason Davies
Date:
Sorry, I forgot to attach the file. How embarrassing :)

--
Jason Davies

jason@netspade.com
Hi Dave,

Here is a diff against current sources of DatabaseMetaData (jdbc2) for fixing getExportedKeys(). Out of interest, why
doesn'tit compile under Java 1.1? 

Jason

On Fri, Nov 02, 2001 at 02:23:57PM -0500, Dave Cramer wrote:
> Jason,
>
> If you could send me a diff against the current sources that would
> remove any possibility of me making another mistake, please forward one
>
> Dave
>
> -----Original Message-----
> From: Jason Davies [mailto:jason@netspade.com]
> Sent: November 2, 2001 1:55 PM
> To: Dave Cramer
> Cc: PostgreSQL JDBC
> Subject: Re: [JDBC] Staroffice, druid, dbvisualizer compatability
>
>
> Hi Dave,
>
> This doesn't appear to be the same as the diff I submitted, because the
> SQL query for DatabaseMetaData.getExportedKeys() is wrong (both for
> jdbc1 and jdbc2). Could you fix that (just ask if you want another diff
> against current cvs). For getExportedKeys() the query seems to be the
> same as for getImportedKeys():)
>
> Thanks,
> Jason
>
> On Wed, Oct 31, 2001 at 03:47:26PM -0500, Dave Cramer wrote:
> > I have committed my changes which include Jason Davies patch to the
> > repository, so if you want to build your own driver you can update
> your
> > source from cvs. I have also built a binary on
> http://jdbc.fastcrypt.com
> >
> >
> > The only one I have gotten to work is the version 1.3 jar ?? If anyone
> > gets the 1.2 jar working let me know. It doesn't seem to connect??
> >
> > Also Jason's patch fails to compile under jdk 1.1, I will get around
> to
> > fixing that shortly
> >
> >
> > I would appreciate it if anyone who has more extensive experience with
> > the ERD tools exercise the driver and let me know if there are any
> > problems
> >
> > Thanks,
> >
> > Dave
> >
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
>
> --
> Jason Davies
>
> jason@netspade.com

--
Jason Davies

jason@netspade.com

Attachment

Re: [jason@netspade.com: DatabaseMetaData.java.diff]

From
"Dave Cramer"
Date:
Jason,

The current sources should be patched as per your patch. I also fixed
jdbc1 so it would compile

Dave

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jason Davies
Sent: November 2, 2001 5:16 PM
To: Dave Cramer
Cc: PostgreSQL JDBC
Subject: [JDBC] [jason@netspade.com: DatabaseMetaData.java.diff]



Sorry, I forgot to attach the file. How embarrassing :)

--
Jason Davies

jason@netspade.com


Re: [jason@netspade.com: DatabaseMetaData.java.diff]

From
Jason Davies
Date:
Dave,

Here is yet another patch for DatabaseMetaData which does several things:
a) Currently an extra key is returned in both getExportedKeys() and getImportedKeys(). So a foreign key relationship,
duplicatekeys are returned. This has been fixed. 
b) PK_NAME is now returned.
c) The whole SQL query has been optimized (no more ugly inner selects).
d) The getExportedKeys() and getImportedKeys() implementation has been put into a single getImportedExportedKeys() to
saveduplcating the code. 
e) KEY_SEQ is now also returned.

There is however one problem to do with multiple foreign key columns. Should they be returned as a single row,
separatedby commas? Or returned in separate rows? By multiple foreign key columns I mean, "alter table ptable add
constraintptable_fkey foreign key (pcol1, pcol2) references ftable (fcol1, fcol2)". 

I think returning separate rows is the most correct way to do it, assuming the SQL statement above is equivalent to 2
separatefkeys. 

Any comments are welcome,

Jason

On Fri, Nov 02, 2001 at 07:04:16PM -0500, Dave Cramer wrote:
> Jason,
>
> The current sources should be patched as per your patch. I also fixed
> jdbc1 so it would compile
>
> Dave
>
> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jason Davies
> Sent: November 2, 2001 5:16 PM
> To: Dave Cramer
> Cc: PostgreSQL JDBC
> Subject: [JDBC] [jason@netspade.com: DatabaseMetaData.java.diff]
>
>
>
> Sorry, I forgot to attach the file. How embarrassing :)
>
> --
> Jason Davies
>
> jason@netspade.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Jason Davies

jason@netspade.com

Attachment

Re: [jason@netspade.com: DatabaseMetaData.java.diff]

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.  JDBC maintainers will
review.


---------------------------------------------------------------------------


Jason Davies wrote:

Checking application/pgp-signature: FAILURE
-- Start of PGP signed section.
> Dave,
>
> Here is yet another patch for DatabaseMetaData which does several things:
> a) Currently an extra key is returned in both getExportedKeys() and getImportedKeys(). So a foreign key relationship,
duplicatekeys are returned. This has been fixed. 
> b) PK_NAME is now returned.
> c) The whole SQL query has been optimized (no more ugly inner selects).
> d) The getExportedKeys() and getImportedKeys() implementation has been put into a single getImportedExportedKeys() to
saveduplcating the code. 
> e) KEY_SEQ is now also returned.
>
> There is however one problem to do with multiple foreign key columns. Should they be returned as a single row,
separatedby commas? Or returned in separate rows? By multiple foreign key columns I mean, "alter table ptable add
constraintptable_fkey foreign key (pcol1, pcol2) references ftable (fcol1, fcol2)". 
>
> I think returning separate rows is the most correct way to do it, assuming the SQL statement above is equivalent to 2
separatefkeys. 
>
> Any comments are welcome,
>
> Jason
>
> On Fri, Nov 02, 2001 at 07:04:16PM -0500, Dave Cramer wrote:
> > Jason,
> >
> > The current sources should be patched as per your patch. I also fixed
> > jdbc1 so it would compile
> >
> > Dave
> >
> > -----Original Message-----
> > From: pgsql-jdbc-owner@postgresql.org
> > [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jason Davies
> > Sent: November 2, 2001 5:16 PM
> > To: Dave Cramer
> > Cc: PostgreSQL JDBC
> > Subject: [JDBC] [jason@netspade.com: DatabaseMetaData.java.diff]
> >
> >
> >
> > Sorry, I forgot to attach the file. How embarrassing :)
> >
> > --
> > Jason Davies
> >
> > jason@netspade.com
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
> --
> Jason Davies
>
> jason@netspade.com

[ Attachment, skipping... ]
-- End of PGP section, PGP failed!

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

Re: [jason@netspade.com: DatabaseMetaData.java.diff]

From
Jason Davies
Date:
My patch has already been applied, I believe.

--Jase.

On Fri, Feb 22, 2002 at 02:52:30PM -0500, Bruce Momjian wrote:
>
> Your patch has been added to the PostgreSQL unapplied patches list at:
>
>     http://candle.pha.pa.us/cgi-bin/pgpatches
>
> I will try to apply it within the next 48 hours.  JDBC maintainers will
> review.
>
>
> ---------------------------------------------------------------------------
>
>
> Jason Davies wrote:
>
> Checking application/pgp-signature: FAILURE
> -- Start of PGP signed section.
> > Dave,
> >
> > Here is yet another patch for DatabaseMetaData which does several things:
> > a) Currently an extra key is returned in both getExportedKeys() and getImportedKeys(). So a foreign key
relationship,duplicate keys are returned. This has been fixed. 
> > b) PK_NAME is now returned.
> > c) The whole SQL query has been optimized (no more ugly inner selects).
> > d) The getExportedKeys() and getImportedKeys() implementation has been put into a single getImportedExportedKeys()
tosave duplcating the code. 
> > e) KEY_SEQ is now also returned.
> >
> > There is however one problem to do with multiple foreign key columns. Should they be returned as a single row,
separatedby commas? Or returned in separate rows? By multiple foreign key columns I mean, "alter table ptable add
constraintptable_fkey foreign key (pcol1, pcol2) references ftable (fcol1, fcol2)". 
> >
> > I think returning separate rows is the most correct way to do it, assuming the SQL statement above is equivalent to
2separate fkeys. 
> >
> > Any comments are welcome,
> >
> > Jason
> >
> > On Fri, Nov 02, 2001 at 07:04:16PM -0500, Dave Cramer wrote:
> > > Jason,
> > >
> > > The current sources should be patched as per your patch. I also fixed
> > > jdbc1 so it would compile
> > >
> > > Dave
> > >
> > > -----Original Message-----
> > > From: pgsql-jdbc-owner@postgresql.org
> > > [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jason Davies
> > > Sent: November 2, 2001 5:16 PM
> > > To: Dave Cramer
> > > Cc: PostgreSQL JDBC
> > > Subject: [JDBC] [jason@netspade.com: DatabaseMetaData.java.diff]
> > >
> > >
> > >
> > > Sorry, I forgot to attach the file. How embarrassing :)
> > >
> > > --
> > > Jason Davies
> > >
> > > jason@netspade.com
> > >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 2: you can get off all lists at once with the unregister command
> > >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >
> > --
> > Jason Davies
> >
> > jason@netspade.com
>
> [ Attachment, skipping... ]
> -- End of PGP section, PGP failed!
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

--
Jason Davies

jason@netspade.com

Re: [jason@netspade.com: DatabaseMetaData.java.diff]

From
Bruce Momjian
Date:
Oh, sorry, I missed that.  Patch removed.  Thanks.  Sorry.

---------------------------------------------------------------------------

Jason Davies wrote:
> My patch has already been applied, I believe.
>
> --Jase.
>
> On Fri, Feb 22, 2002 at 02:52:30PM -0500, Bruce Momjian wrote:
> >
> > Your patch has been added to the PostgreSQL unapplied patches list at:
> >
> >     http://candle.pha.pa.us/cgi-bin/pgpatches
> >
> > I will try to apply it within the next 48 hours.  JDBC maintainers will
> > review.
> >
> >
> > ---------------------------------------------------------------------------
> >
> >
> > Jason Davies wrote:
> >
> > Checking application/pgp-signature: FAILURE
> > -- Start of PGP signed section.
> > > Dave,
> > >
> > > Here is yet another patch for DatabaseMetaData which does several things:
> > > a) Currently an extra key is returned in both getExportedKeys() and getImportedKeys(). So a foreign key
relationship,duplicate keys are returned. This has been fixed. 
> > > b) PK_NAME is now returned.
> > > c) The whole SQL query has been optimized (no more ugly inner selects).
> > > d) The getExportedKeys() and getImportedKeys() implementation has been put into a single
getImportedExportedKeys()to save duplcating the code. 
> > > e) KEY_SEQ is now also returned.
> > >
> > > There is however one problem to do with multiple foreign key columns. Should they be returned as a single row,
separatedby commas? Or returned in separate rows? By multiple foreign key columns I mean, "alter table ptable add
constraintptable_fkey foreign key (pcol1, pcol2) references ftable (fcol1, fcol2)". 
> > >
> > > I think returning separate rows is the most correct way to do it, assuming the SQL statement above is equivalent
to2 separate fkeys. 
> > >
> > > Any comments are welcome,
> > >
> > > Jason
> > >
> > > On Fri, Nov 02, 2001 at 07:04:16PM -0500, Dave Cramer wrote:
> > > > Jason,
> > > >
> > > > The current sources should be patched as per your patch. I also fixed
> > > > jdbc1 so it would compile
> > > >
> > > > Dave
> > > >
> > > > -----Original Message-----
> > > > From: pgsql-jdbc-owner@postgresql.org
> > > > [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jason Davies
> > > > Sent: November 2, 2001 5:16 PM
> > > > To: Dave Cramer
> > > > Cc: PostgreSQL JDBC
> > > > Subject: [JDBC] [jason@netspade.com: DatabaseMetaData.java.diff]
> > > >
> > > >
> > > >
> > > > Sorry, I forgot to attach the file. How embarrassing :)
> > > >
> > > > --
> > > > Jason Davies
> > > >
> > > > jason@netspade.com
> > > >
> > > >
> > > > ---------------------------(end of broadcast)---------------------------
> > > > TIP 2: you can get off all lists at once with the unregister command
> > > >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> > >
> > > --
> > > Jason Davies
> > >
> > > jason@netspade.com
> >
> > [ Attachment, skipping... ]
> > -- End of PGP section, PGP failed!
> >
> > --
> >   Bruce Momjian                        |  http://candle.pha.pa.us
> >   pgman@candle.pha.pa.us               |  (610) 853-3000
> >   +  If your life is a hard drive,     |  830 Blythe Avenue
> >   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
>
> --
> Jason Davies
>
> jason@netspade.com
>

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