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

 
 

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

Submitter:  None
Submitted:  Sun 22 Feb 2015 11:15:17 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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


if ( $1 >8 || $1 == 8 && $2 >= 3 )


be written as

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

?

Olaf

Olaf Till <i7tiol>
Group 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>
Group 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>
Group 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>
Group 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>
Group Member
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>
Group Member
Sun 22 Feb 2015 11:42:48 PM UTC, comment #1: 

Adding maintainer of database package to cc list

Carnë Draug <carandraug>
Group 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 Files:
   
   
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
  • -email is unavailable- added by zeuz (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by i7tiol (Posted a comment)
  • -email is unavailable- added by carandraug (Olaf Till - maintainer of database package)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-25 zeuz Attached File- Added pg_version_check.diff, #33185
    2015-02-24 carandraug StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-02-23 mtmiller Item GroupSegfault, Bus Error, etc. Feature Request
        StatusNone Confirmed
        Operating SystemMicrosoft Windows Any
    2015-02-22 carandraug Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code