dbTalk Databases Forums  

[BUGS] BUG #1495: RPM: wrong quoting of error message about old database format after upgrading

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1495: RPM: wrong quoting of error message about old database format after upgrading in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Markus Bertheau
 
Posts: n/a

Default [BUGS] BUG #1495: RPM: wrong quoting of error message about old database format after upgrading - 02-21-2005 , 08:12 AM







The following bug has been logged online:

Bug reference: 1495
Logged by: Markus Bertheau
Email address: twanger (AT) bluetwanger (DOT) de
PostgreSQL version: 8.0.1
Operating system: Fedora Core 3
Description: RPM: wrong quoting of error message about old database
format after upgrading
Details:

[bertheau@dicaprio ~]$ sudo /etc/init.d/postgresql start

An old version of the database format was found.\nYou need to upgrade the
data format before using PostgreSQL.\nSee (Your System's documentation
directory)/postgresql-8.0/README.rpm-dist for more information.

This is the literal output. The \n's are overquoted.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1495: RPM: wrong quoting of error message about old database format after upgrading - 02-21-2005 , 03:55 PM






"Markus Bertheau" <twanger (AT) bluetwanger (DOT) de> writes:
Quote:
Description: RPM: wrong quoting of error message about old database
format after upgrading

[bertheau@dicaprio ~]$ sudo /etc/init.d/postgresql start

An old version of the database format was found.\nYou need to upgrade the
data format before using PostgreSQL.\nSee (Your System's documentation
directory)/postgresql-8.0/README.rpm-dist for more information.

This is the literal output. The \n's are overquoted.
Good catch. That code has got worse problems too: it ought to be able
to report the correct location of the README.rpm-dist file, but it fails
because of confusion about which version number to use.

I've applied fixes in Red Hat's current RPMs, as attached.

regards, tom lane

Index: postgresql.init
================================================== =================
RCS file: /cvs/dist/rpms/postgresql/devel/postgresql.init,v
retrieving revision 1.19
retrieving revision 1.20
diff -c -r1.19 -r1.20
*** postgresql.init 19 Jan 2005 05:02:10 -0000 1.19
--- postgresql.init 21 Feb 2005 21:44:36 -0000 1.20
***************
*** 62,69 ****
# postgres-owned processes laying about.


! # PGVERSION is:
! PGVERSION=8.0

# Source function library.
INITD=/etc/rc.d/init.d
--- 62,72 ----
# postgres-owned processes laying about.


! # PGVERSION is the full package version, e.g., 7.4.7
! # Note: the specfile ordinarily updates this during install
! PGVERSION=xxxx
! # PGMAJORVERSION is major version, e.g., 7.4 (this should match PG_VERSION)
! PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'`

# Source function library.
INITD=/etc/rc.d/init.d
***************
*** 134,140 ****
then
# Check version of existing PGDATA

! if [ `cat "$PGDATA/PG_VERSION"` != "$PGVERSION" ]
then
SYSDOCDIR="(Your System's documentation directory)"
if [ -d "/usr/doc/postgresql-$PGVERSION" ]
--- 137,143 ----
then
# Check version of existing PGDATA

! if [ x`cat "$PGDATA/PG_VERSION"` != x"$PGMAJORVERSION" ]
then
SYSDOCDIR="(Your System's documentation directory)"
if [ -d "/usr/doc/postgresql-$PGVERSION" ]
***************
*** 154,160 ****
SYSDOCDIR=/usr/share/doc/packages
fi
echo
! echo $"An old version of the database format was found.\nYou need to upgrade the data format before using PostgreSQL.\nSee $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information."
exit 1
fi

--- 157,165 ----
SYSDOCDIR=/usr/share/doc/packages
fi
echo
! echo $"An old version of the database format was found."
! echo $"You need to upgrade the data format before using PostgreSQL."
! echo $"See $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information."
exit 1
fi

Index: postgresql.spec
================================================== =================
RCS file: /cvs/dist/rpms/postgresql/devel/postgresql.spec,v
retrieving revision 1.43
retrieving revision 1.44
diff -c -r1.43 -r1.44
*** postgresql.spec 31 Jan 2005 03:15:07 -0000 1.43
--- postgresql.spec 21 Feb 2005 21:44:36 -0000 1.44
***************
*** 64,70 ****
# Pre-release RPM's should not be put up on the public ftp.postgresql.org server
# -- only test releases or full releases should be.

! Release: 1
License: BSD
Group: Applications/Databases
Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
--- 64,70 ----
# Pre-release RPM's should not be put up on the public ftp.postgresql.org server
# -- only test releases or full releases should be.

! Release: 2
License: BSD
Group: Applications/Databases
Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
***************
*** 483,489 ****
if [ -d /etc/rc.d/init.d ]
then
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
! install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
fi

# Remove stuff we don't want to ship.
--- 483,490 ----
if [ -d /etc/rc.d/init.d ]
then
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
! sed 's/^PGVERSION=.*$/PGVERSION=%{version}/' <%{SOURCE3} >postgresql.init
! install -m 755 postgresql.init $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql
fi

# Remove stuff we don't want to ship.
***************
*** 784,789 ****
--- 785,794 ----
%endif

%changelog
+ * Mon Feb 21 2005 Tom Lane <tgl (AT) redhat (DOT) com> 8.0.1-2
+ - Repair improper error message in init script when PGVERSION doesn't match.
+ - Arrange for auto update of version embedded in init script.
+
* Sun Jan 30 2005 Tom Lane <tgl (AT) redhat (DOT) com> 8.0.1-1
- Update to PostgreSQL 8.0.1.
- Add versionless symlinks to jar files (bz#145744)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.