Thread: Re: [BUGS] no meaningful way to determine fe or be version?
> Bruce Momjian <pgman@candle.pha.pa.us> writes: > > Yes, should we return the client or server version from the interface? > > If we return the server version, how does someone query the client version? > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > are actually fine - they return a major/minor version that have been > getting manually updated (they're much more visible, being in > org/postgresql/Driver.java). the server-side interfaces > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > tied to the server, return hardcoded strings and haven't been getting > updated regularly. Oh, really. I didn't know there was that distinction. Sounds like they should be callling SELECT version(). Comments, Java folks? -- 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, Pennsylvania19026
Bruce Momjian wrote: > > > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > > Yes, should we return the client or server version from the interface? > > > If we return the server version, how does someone query the client version? > > > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > > are actually fine - they return a major/minor version that have been > > getting manually updated (they're much more visible, being in > > org/postgresql/Driver.java). the server-side interfaces > > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > > tied to the server, return hardcoded strings and haven't been getting > > updated regularly. > > Oh, really. I didn't know there was that distinction. Sounds like they > should be callling SELECT version(). Comments, Java folks? > I remember someone posting a patch saying that he changed the code to do that. Or saying he was going to post a patch, I forget. Anyway, I just checked and it isn't in the cvs. -- Joseph Shraibman jks@selectacast.net Increase signal to noise ratio. http://www.targabot.com
Bruce Momjian wrote: > > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > > are actually fine - they return a major/minor version that have been > > getting manually updated (they're much more visible, being in > > org/postgresql/Driver.java). the server-side interfaces > > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > > tied to the server, return hardcoded strings and haven't been getting > > updated regularly. > > Oh, really. I didn't know there was that distinction. Sounds like they > should be callling SELECT version(). Comments, Java folks? I posted a patch for the JDBC driver to pgsql-interfaces to do just that some time ago. Don't know what happened to it, though .. /Anders ________________________________________________________________________ A n d e r s B e n g t s s o n anders@lecando.com http://www.lecando.com
This concerns me. Did we lose a patch here? Can you send it again? > Bruce Momjian wrote: > > > > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > > > are actually fine - they return a major/minor version that have been > > > getting manually updated (they're much more visible, being in > > > org/postgresql/Driver.java). the server-side interfaces > > > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > > > tied to the server, return hardcoded strings and haven't been getting > > > updated regularly. > > > > Oh, really. I didn't know there was that distinction. Sounds like they > > should be callling SELECT version(). Comments, Java folks? > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > some time ago. Don't know what happened to it, though .. > > /Anders > ________________________________________________________________________ > A n d e r s B e n g t s s o n anders@lecando.com > http://www.lecando.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, Pennsylvania19026
I think Peter Mount looked at it, but there where some big changes to the JDBC driver going on at that time. When I look at the code in CVS now it looks nothing like what it did when I did the patch against it. Anyway, I found my old patch in the archives: http://www.postgresql.org/mhonarc/pgsql-interfaces/2000-09/msg00051.html /Anders Bruce Momjian wrote: > > This concerns me. Did we lose a patch here? Can you send it again? > > > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > > some time ago. Don't know what happened to it, though .. _____________________________________________________________________ A n d e r s B e n g t s s o n anders@lecando.com Stockholm, Sweden
Try submitting it to the psgsl-patches list. Anders Bengtsson wrote: > > Bruce Momjian wrote: > > > > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > > > are actually fine - they return a major/minor version that have been > > > getting manually updated (they're much more visible, being in > > > org/postgresql/Driver.java). the server-side interfaces > > > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > > > tied to the server, return hardcoded strings and haven't been getting > > > updated regularly. > > > > Oh, really. I didn't know there was that distinction. Sounds like they > > should be callling SELECT version(). Comments, Java folks? > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > some time ago. Don't know what happened to it, though .. > > /Anders > ________________________________________________________________________ > A n d e r s B e n g t s s o n anders@lecando.com > http://www.lecando.com -- Joseph Shraibman jks@selectacast.net Increase signal to noise ratio. http://www.targabot.com
Thanks. This URL was a huge help. I applied the change to the proper function. > I think Peter Mount looked at it, but there where some big changes to > the JDBC driver going on at that time. When I look at the code in CVS > now it looks nothing like what it did when I did the patch against it. > > Anyway, I found my old patch in the archives: > http://www.postgresql.org/mhonarc/pgsql-interfaces/2000-09/msg00051.html > > /Anders > > Bruce Momjian wrote: > > > > This concerns me. Did we lose a patch here? Can you send it again? > > > > > > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > > > some time ago. Don't know what happened to it, though .. > > _____________________________________________________________________ > A n d e r s B e n g t s s o n anders@lecando.com > Stockholm, Sweden > -- 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, Pennsylvania19026
OK, I think I understand this now. getDatabaseProductVersion() calls getVersion, which is defined in Driver.java.in as the version string from configure. It returns the version of the client jdbc code. To get the server version, you need that SELECT you suggested. Is that OK? > I think Peter Mount looked at it, but there where some big changes to > the JDBC driver going on at that time. When I look at the code in CVS > now it looks nothing like what it did when I did the patch against it. > > Anyway, I found my old patch in the archives: > http://www.postgresql.org/mhonarc/pgsql-interfaces/2000-09/msg00051.html > > /Anders > > Bruce Momjian wrote: > > > > This concerns me. Did we lose a patch here? Can you send it again? > > > > > > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > > > some time ago. Don't know what happened to it, though .. > > _____________________________________________________________________ > A n d e r s B e n g t s s o n anders@lecando.com > Stockholm, Sweden > -- 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, Pennsylvania19026
Sorry, I am just now catching up to the fact that this problem was already discussed. I have gotten the patch from the URL supplied by the author, and have applied it to the CVS tree. It will appear in tomorrow's snapshot, and in 7.1. Thanks for the patch. Someone else we complaining about this also just last week. I will let him know it will be fixed in 7.1. > Try submitting it to the psgsl-patches list. > > Anders Bengtsson wrote: > > > > Bruce Momjian wrote: > > > > > > > sorry, yes. the client-side interfaces (DatabaseMetaData.getDriver*) > > > > are actually fine - they return a major/minor version that have been > > > > getting manually updated (they're much more visible, being in > > > > org/postgresql/Driver.java). the server-side interfaces > > > > (DatabaseMetaData.getDatabase{Name,Version}) are the ones that aren't > > > > tied to the server, return hardcoded strings and haven't been getting > > > > updated regularly. > > > > > > Oh, really. I didn't know there was that distinction. Sounds like they > > > should be callling SELECT version(). Comments, Java folks? > > > > I posted a patch for the JDBC driver to pgsql-interfaces to do just that > > some time ago. Don't know what happened to it, though .. > > > > /Anders > > ________________________________________________________________________ > > A n d e r s B e n g t s s o n anders@lecando.com > > http://www.lecando.com > > -- > Joseph Shraibman > jks@selectacast.net > Increase signal to noise ratio. http://www.targabot.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, Pennsylvania19026