bugGNU Octave - Bugs: bug #44345, Database package: Error connecting...

 
 

bug #44345: Database package: Error connecting to older Postgresql

Submitted by:  None
Submitted on:  Sun 22 Feb 2015 11:15:17 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 25 Feb 2015 06:47:26 PM UTC, comment #8:

Thanks, but still two things:

1. I wouldn't rely on 'pg_config --version' always prepending the program name, there might be versions (maybe in the future) in which only the version number is printed. This was cared for by the previous regular expression, could you do something similar with awk?

2. Can't

be written as

+verbatim
if ( $1 >= 8 && $2 >= 3 )
-verbatim-

?

Olaf

Olaf Till <i7tiol>
Project Member
Wed 25 Feb 2015 05:48:35 PM UTC, comment #7:

(this is Claudius, the original submitter)

Wow, I spent the past three days in bed and now - going online - it's already fixed :)

I adapted configure.ac to check for the library version using awk (Tried PKG_CHECK_MODULES, but libpq doesn't register with pkg-config :()
-> removed the dependency on Octave
-> reduced the required Autoconf version to 2.59 (RHEL 5)
-> added dependency on awk. As Octave itself depends on awk, this shouldn't be a further limitation
-> Distributions on Cygwin don't include psql nor pg_config, so builds will probably fail there (same before the patch ;))

The RHEL 5 machine is my default testing target, as we have a homogenous Redhat landscape here (v5-v7). Wasn't my choice, but I can't complain too much.

(file #33185)

Claudius Zingerli <zeuz>
Tue 24 Feb 2015 10:16:31 AM UTC, comment #6:

Yes, something similar. Done and commit-ed to SVN. Olaf

Olaf Till <i7tiol>
Project Member
Mon 23 Feb 2015 05:18:45 PM UTC, comment #5:

You could have a configure script that checks the psql version during installation and fail.

Carnë Draug <carandraug>
Project Member
Mon 23 Feb 2015 04:21:04 PM UTC, comment #4:

Mike:

Quote from the original report, note the part after the last ",":

"So, would it be possible to catch this error and output a message like "Postgres minimum supported version is 8.3", or handle the error? (=not relying on typearray)"

Quote from my answer:

"I agree the package should explicitely require a minimal postgresql version, I'll care for this."

Olaf

Olaf Till <i7tiol>
Project Member
Mon 23 Feb 2015 04:06:31 PM UTC, comment #3:

The original report doesn't seem to be asking for you to support postgresql < 8.3, just to add a better error message to catch whatever feature it is that requires 8.3 and report to the user something along the lines of "postgresql 8.3 or newer is required".

Mike Miller <mtmiller>
Project Administrator
Mon 23 Feb 2015 03:44:52 PM UTC, comment #2:

Seeing your report I considered to handle postgresql < 8.3, if possible, but the necessary changes seem to need much work and the code would probably be terrible. Sorry, but I don't think I'll undertake this. I'm glad to hear of somebody who tries to use the package, but couldn't you switch to a more recent GNU/Linux distribution (in Debian, e.g., you needn't pay for upgrades)? There might be more advantages in this than just having the database package.

I agree the package should explicitely require a minimal postgresql version, I'll care for this.

Thank you for the report anyway, although I actually could not help you ...

Olaf

Olaf Till <i7tiol>
Project Member
Sun 22 Feb 2015 11:42:48 PM UTC, comment #1:

Adding maintainer of database package to cc list

Carnë Draug <carandraug>
Project Member
Sun 22 Feb 2015 11:15:17 PM UTC, original submission:

I tried to connect to postgresql 8.1.23 (Current version on RHEL 5)

Connection fails with:
"
octave:14> et.db.pgconn = pq_connect(con_str);
error: octave_pq_fill_base_types: fatal error: ERROR: column "typarray" does not exist

error: could not read types
error: called from:
error: /usr/share/octave/packages/database-2.3.0/pq_connect.m at line 112, column 8
"

The error happens here:
http://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/main/database/src/pq_connection.cc#l212

Checking through the Postgresql docs, I found:
"
The old naming convention is still honored when possible, but application code should no longer depend on it. Instead use the new pg_type.typarray column to identify the array data type associated with a given type.
"
(http://www.postgresql.org/docs/8.3/static/release-8-3.html)

Ok, they started with typearray at Postgresql 8.3...
RHEL 5 is still supported until March 31, 2017, but they won't upgrade anything except for critical issues.

So, would it be possible to catch this error and output a message like "Postgres minimum supported version is 8.3", or handle the error? (=not relying on typearray)

Claudius

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #33185:  pg_version_check.diff added by zeuz (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by zeuz (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by i7tiol (Posted a comment)
  • -unavailable- added by carandraug (Olaf Till - maintainer of database package)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 25 Feb 2015 05:48:35 PM UTCzeuzAttached File-=>Added pg_version_check.diff, #33185
    Tue 24 Feb 2015 11:48:00 AM UTCcarandraugStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Mon 23 Feb 2015 04:06:31 PM UTCmtmillerItem GroupSegfault, Bus Error, etc.=>Feature Request
      StatusNone=>Confirmed
      Operating SystemMicrosoft Windows=>Any
    Sun 22 Feb 2015 11:42:48 PM UTCcarandraugCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1