Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stamp version 10devel #2

Open
wants to merge 2 commits into
base: travis
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
sudo: false
language: java

before_script:
- ./.travis/make_postgres.sh
- psql -U postgres -c "create user test with password 'test';"
- psql -c 'create database test owner test;' -U postgres
- echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc
- psql test -c 'CREATE EXTENSION hstore;' -U postgres

script:
# make sure previous build artifacts are not used for subsequent builds
- ./.travis/travis_build.sh

before_cache:
# No sense in caching current build artifacts
rm -rf $HOME/.m2/repository/org/postgresql

# Skip default "mvn install" issued by Travis
# Root project cannot be compiled with older JDKs, so it makes sense to just skip the step
install: true

cache:
directories:
- '$HOME/.m2/repository'

matrix:
fast_finish: true
include:
- env:
- TEST=PG_CHECK
script: make check
- env:
- TEST=PG_CHECK_WORLD
script: PGHOST=localhost make check-world
- jdk: oraclejdk8
env:
- TEST=pgjdbc
script: ./.travis/pgjdbc_check.sh

branches:
only:
- travis
9 changes: 9 additions & 0 deletions .travis/make_postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -x -e

PREFIX=$HOME/pg_head

./configure --prefix=$PREFIX

# Build PostgreSQL from source and start the DB
make && make install && $PREFIX/bin/pg_ctl -D $PREFIX/data initdb && $PREFIX/bin/pg_ctl -D $PREFIX/data -l postgres.log start
8 changes: 8 additions & 0 deletions .travis/pgjdbc_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -x -e

git clone --depth=1 https://github.com/pgjdbc/pgjdbc.git

cd pgjdbc

mvn clean package -B -V
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[![Build Status](https://travis-ci.org/vlsi/postgres.svg?branch=travis)](https://travis-ci.org/vlsi/postgres)

PostgreSQL Database Management System
=====================================

This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions. This distribution also contains C language bindings.

PostgreSQL has many language interfaces, many of which are listed here:

http://www.postgresql.org/download

See the file INSTALL for instructions on how to build and install
PostgreSQL. That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system. Copyright and license information can be found in the
file COPYRIGHT. A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
http://www.postgresql.org/download/. For more information look at our
web site located at http://www.postgresql.org/.
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6beta3.
# Generated by GNU Autoconf 2.69 for PostgreSQL 10devel.
#
# Report bugs to <pgsql-bugs@postgresql.org>.
#
Expand Down Expand Up @@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='9.6beta3'
PACKAGE_STRING='PostgreSQL 9.6beta3'
PACKAGE_VERSION='10devel'
PACKAGE_STRING='PostgreSQL 10devel'
PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
PACKAGE_URL=''

Expand Down Expand Up @@ -1398,7 +1398,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 9.6beta3 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 10devel to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1463,7 +1463,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 9.6beta3:";;
short | recursive ) echo "Configuration of PostgreSQL 10devel:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1615,7 +1615,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 9.6beta3
PostgreSQL configure 10devel
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2326,7 +2326,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by PostgreSQL $as_me 9.6beta3, which was
It was created by PostgreSQL $as_me 10devel, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2711,7 +2711,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
configure_args=$ac_configure_args


PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -16433,7 +16433,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 9.6beta3, which was
This file was extended by PostgreSQL $as_me 10devel, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -16503,7 +16503,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 9.6beta3
PostgreSQL config.status 10devel
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
4 changes: 2 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros

AC_INIT([PostgreSQL], [9.6beta3], [pgsql-bugs@postgresql.org])
AC_INIT([PostgreSQL], [10devel], [pgsql-bugs@postgresql.org])

m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
Expand All @@ -29,7 +29,7 @@ AC_CONFIG_AUX_DIR(config)
AC_PREFIX_DEFAULT(/usr/local/pgsql)
AC_SUBST(configure_args, [$ac_configure_args])

[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`]
[PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`]
AC_SUBST(PG_MAJORVERSION)
AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major version as a string])

Expand Down
2 changes: 1 addition & 1 deletion doc/bug.template
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ System Configuration:

Operating System (example: Linux 2.4.18) :

PostgreSQL version (example: PostgreSQL 9.6beta3): PostgreSQL 9.6beta3
PostgreSQL version (example: PostgreSQL 10devel): PostgreSQL 10devel

Compiler used (example: gcc 3.3.5) :

Expand Down
31 changes: 20 additions & 11 deletions doc/src/sgml/runtime.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1601,17 +1601,26 @@ $ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput
</para>

<para>
<productname>PostgreSQL</> major versions are represented by the
first two digit groups of the version number, e.g., 8.4.
<productname>PostgreSQL</> minor versions are represented by the
third group of version digits, e.g., 8.4.2 is the second minor
release of 8.4. Minor releases never change the internal storage
format and are always compatible with earlier and later minor
releases of the same major version number, e.g., 8.4.2 is compatible
with 8.4, 8.4.1 and 8.4.6. To update between compatible versions,
you simply replace the executables while the server is down and
restart the server. The data directory remains unchanged &mdash;
minor upgrades are that simple.
Current <productname>PostgreSQL</productname> version numbers consist of a
major and a minor version number. For example, in the version number 10.1,
the 10 is the major version number and the 1 is the minor version number,
meaning this would be the first minor release of the major release 10. For
releases before <productname>PostgreSQL</productname> version 10.0, version
numbers consist of three numbers, for example, 9.5.3. In those cases, the
major version consists of the first two digit groups of the version number,
e.g., 9.5, and the minor version is the third number, e.g., 3, meaning this
would be the third minor release of the major release 9.5.
</para>

<para>
Minor releases never change the internal storage format and are always
compatible with earlier and later minor releases of the same major version
number. For example, version 10.1 is compatible with version 10.0 and
version 10.6. Similarly, for example, 9.5.3 is compatible with 9.5.0,
9.5.1, and 9.5.6. To update between compatible versions, you simply
replace the executables while the server is down and restart the server.
The data directory remains unchanged &mdash; minor upgrades are that
simple.
</para>

<para>
Expand Down
4 changes: 2 additions & 2 deletions src/backend/catalog/genbki.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
die "Version must be in format nn.nn.\n"
if !($major_version =~ /^\d+\.\d+$/);
die "Invalid version string.\n"
if !($major_version =~ /^\d+$/);
}
else
{
Expand Down
18 changes: 7 additions & 11 deletions src/backend/utils/init/miscinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,16 +1334,12 @@ ValidatePgVersion(const char *path)
char full_path[MAXPGPATH];
FILE *file;
int ret;
long file_major,
file_minor;
long my_major = 0,
my_minor = 0;
long file_major;
long my_major = 0;
char *endptr;
const char *version_string = PG_VERSION;

my_major = strtol(version_string, &endptr, 10);
if (*endptr == '.')
my_minor = strtol(endptr + 1, NULL, 10);

snprintf(full_path, sizeof(full_path), "%s/PG_VERSION", path);

Expand All @@ -1362,8 +1358,8 @@ ValidatePgVersion(const char *path)
errmsg("could not open file \"%s\": %m", full_path)));
}

ret = fscanf(file, "%ld.%ld", &file_major, &file_minor);
if (ret != 2)
ret = fscanf(file, "%ld", &file_major);
if (ret != 1)
ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("\"%s\" is not a valid data directory",
Expand All @@ -1374,13 +1370,13 @@ ValidatePgVersion(const char *path)

FreeFile(file);

if (my_major != file_major || my_minor != file_minor)
if (my_major != file_major)
ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("database files are incompatible with server"),
errdetail("The data directory was initialized by PostgreSQL version %ld.%ld, "
errdetail("The data directory was initialized by PostgreSQL version %ld, "
"which is not compatible with this version %s.",
file_major, file_minor, version_string)));
file_major, version_string)));
}

/*-------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/bin/pg_upgrade/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,8 @@ get_bin_version(ClusterInfo *cluster)
char cmd[MAXPGPATH],
cmd_output[MAX_STRING];
FILE *output;
int pre_dot,
post_dot;
int pre_dot = 0,
post_dot = 0;

snprintf(cmd, sizeof(cmd), "\"%s/pg_ctl\" --version", cluster->bindir);

Expand All @@ -1093,7 +1093,7 @@ get_bin_version(ClusterInfo *cluster)
if (strchr(cmd_output, '\n') != NULL)
*strchr(cmd_output, '\n') = '\0';

if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) != 2)
if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) < 1)
pg_fatal("could not get version from %s\n", cmd);

cluster->bin_version = (pre_dot * 100 + post_dot) * 100;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/pg_upgrade/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ get_major_server_version(ClusterInfo *cluster)

if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
sscanf(cluster->major_version_str, "%d.%d", &integer_version,
&fractional_version) != 2)
&fractional_version) < 1)
pg_fatal("could not get version from %s\n", cluster->pgdata);

fclose(version_fd);
Expand Down
8 changes: 4 additions & 4 deletions src/include/pg_config.h.win32
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,10 @@
#define PACKAGE_NAME "PostgreSQL"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "PostgreSQL 9.6beta3"
#define PACKAGE_STRING "PostgreSQL 10devel"

/* Define to the version of this package. */
#define PACKAGE_VERSION "9.6beta3"
#define PACKAGE_VERSION "10devel"

/* Define to the name of a signed 128-bit integer type. */
#undef PG_INT128_TYPE
Expand All @@ -566,10 +566,10 @@
#define PG_INT64_TYPE long long int

/* PostgreSQL version as a string */
#define PG_VERSION "9.6beta3"
#define PG_VERSION "10devel"

/* PostgreSQL version as a number */
#define PG_VERSION_NUM 90600
#define PG_VERSION_NUM 100000

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "postgresql"
Expand Down
17 changes: 11 additions & 6 deletions src/interfaces/libpq/fe-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,14 +983,19 @@ pqSaveParameterStatus(PGconn *conn, const char *name, const char *value)

cnt = sscanf(value, "%d.%d.%d", &vmaj, &vmin, &vrev);

if (cnt < 2)
conn->sversion = 0; /* unknown */
else
{
if (cnt == 2)
vrev = 0;
if (cnt == 3)
conn->sversion = (100 * vmaj + vmin) * 100 + vrev;
else if (cnt == 2)
{
if (vmaj >= 10)
conn->sversion = 100 * 100 * vmaj + vmin;
else
conn->sversion = (100 * vmaj + vmin) * 100;
}
else if (cnt == 1)
conn->sversion = 100 * 100 * vmaj;
else
conn->sversion = 0; /* unknown */
}
}

Expand Down
Loading