Skip to content

Commit 671a752

Browse files
committed
Added pgpro_version SQL function and appropriate defines into pg_config.h
1 parent 7aa9bb1 commit 671a752

File tree

7 files changed

+57
-15
lines changed

7 files changed

+57
-15
lines changed

configure

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Guess values for system-dependent variables and create Makefiles.
33
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6rc1.
44
#
5-
# Report bugs to <pgsql-bugs@postgresql.org>.
5+
# Report bugs to <bugs@postgrespro.ru>.
66
#
77
#
88
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -270,10 +270,10 @@ fi
270270
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
271271
else
272272
$as_echo "$0: Please tell bug-autoconf@gnu.org and
273-
$0: pgsql-bugs@postgresql.org about your system, including
274-
$0: any error possibly output before this message. Then
275-
$0: install a modern shell, or manually run the script
276-
$0: under such a shell if you do have one."
273+
$0: bugs@postgrespro.ru about your system, including any
274+
$0: error possibly output before this message. Then install
275+
$0: a modern shell, or manually run the script under such a
276+
$0: shell if you do have one."
277277
fi
278278
exit 1
279279
fi
@@ -582,10 +582,10 @@ MAKEFLAGS=
582582

583583
# Identity of this package.
584584
PACKAGE_NAME='PostgreSQL'
585-
PACKAGE_TARNAME='postgresql'
585+
PACKAGE_TARNAME='postgrespro'
586586
PACKAGE_VERSION='9.6rc1'
587587
PACKAGE_STRING='PostgreSQL 9.6rc1'
588-
PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
588+
PACKAGE_BUGREPORT='bugs@postgrespro.ru'
589589
PACKAGE_URL=''
590590

591591
ac_unique_file="src/backend/access/common/heaptuple.c"
@@ -627,6 +627,7 @@ ac_includes_default="\
627627
#endif"
628628

629629
ac_subst_vars='LTLIBOBJS
630+
PGPRO_VERSION
630631
vpath_build
631632
PG_VERSION_NUM
632633
PROVE
@@ -1450,7 +1451,7 @@ Fine tuning of the installation directories:
14501451
--infodir=DIR info documentation [DATAROOTDIR/info]
14511452
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
14521453
--mandir=DIR man documentation [DATAROOTDIR/man]
1453-
--docdir=DIR documentation root [DATAROOTDIR/doc/postgresql]
1454+
--docdir=DIR documentation root [DATAROOTDIR/doc/postgrespro]
14541455
--htmldir=DIR html documentation [DOCDIR]
14551456
--dvidir=DIR dvi documentation [DOCDIR]
14561457
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1557,7 +1558,7 @@ Some influential environment variables:
15571558
Use these variables to override the choices made by `configure' or to help
15581559
it to find libraries and programs with nonstandard names/locations.
15591560

1560-
Report bugs to <pgsql-bugs@postgresql.org>.
1561+
Report bugs to <bugs@postgrespro.ru>.
15611562
_ACEOF
15621563
ac_status=$?
15631564
fi
@@ -1828,9 +1829,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
18281829
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
18291830
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
18301831
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1831-
( $as_echo "## ---------------------------------------- ##
1832-
## Report this to pgsql-bugs@postgresql.org ##
1833-
## ---------------------------------------- ##"
1832+
( $as_echo "## ---------------------------------- ##
1833+
## Report this to bugs@postgrespro.ru ##
1834+
## ---------------------------------- ##"
18341835
) | sed "s/^/$as_me: WARNING: /" >&2
18351836
;;
18361837
esac
@@ -2680,6 +2681,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
26802681
ac_compiler_gnu=$ac_cv_c_compiler_gnu
26812682

26822683

2684+
PACKAGE_TARNAME=postgrespro
26832685

26842686

26852687

@@ -17748,6 +17750,11 @@ cat >>confdefs.h <<_ACEOF
1774817750
_ACEOF
1774917751

1775017752

17753+
17754+
cat >>confdefs.h <<_ACEOF
17755+
#define PGPRO_VERSION_STR "PostgresPro $PGPRO_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
17756+
_ACEOF
17757+
1775117758
# Supply a numeric version string for use by 3rd party add-ons
1775217759
# awk -F is a regex on some platforms, and not on others, so make "." a tab
1775317760
PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
@@ -17792,6 +17799,7 @@ fi
1779217799

1779317800

1779417801

17802+
1779517803
ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
1779617804

1779717805

@@ -18383,7 +18391,7 @@ $config_links
1838318391
Configuration commands:
1838418392
$config_commands
1838518393

18386-
Report bugs to <pgsql-bugs@postgresql.org>."
18394+
Report bugs to <bugs@postgrespro.ru>."
1838718395

1838818396
_ACEOF
1838918397
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1

configure.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [9.6rc1], [pgsql-bugs@postgresql.org])
20+
AC_INIT([PostgreSQL], [9.6rc1], [bugs@postgrespro.ru],[postgrespro])
21+
PACKAGE_TARNAME=postgrespro
2122

2223
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2324
Untested combinations of 'autoconf' and PostgreSQL versions are not
@@ -2233,6 +2234,9 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR,
22332234
["PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
22342235
[A string containing the version number, platform, and C compiler])
22352236

2237+
AC_DEFINE_UNQUOTED(PGPRO_VERSION_STR,
2238+
["PostgresPro $PGPRO_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
2239+
[A string containing the version number, platform, and C compiler])
22362240
# Supply a numeric version string for use by 3rd party add-ons
22372241
# awk -F is a regex on some platforms, and not on others, so make "." a tab
22382242
[PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
@@ -2267,6 +2271,7 @@ else
22672271
fi
22682272
AC_SUBST(vpath_build)
22692273

2274+
AC_SUBST(PGPRO_VERSION)
22702275

22712276
AC_CONFIG_FILES([GNUmakefile src/Makefile.global])
22722277

doc/src/sgml/func.sgml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15422,6 +15422,11 @@ SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n);
1542215422
<entry><type>text</type></entry>
1542315423
<entry><productname>PostgreSQL</> version information. See also <xref linkend="guc-server-version-num"> for a machine-readable version.</entry>
1542415424
</row>
15425+
<row>
15426+
<entry><literal><function>pgpro_version()</function></literal></entry>
15427+
<entry><type>text</type></entry>
15428+
<entry><productname>PostgresPro</> version information.</entry>
15429+
</row>
1542515430
</tbody>
1542615431
</tgroup>
1542715432
</table>
@@ -15646,7 +15651,13 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
1564615651
(available since 8.2) or <xref linkend="libpq-pqserverversion"> instead
1564715652
of parsing the text version.
1564815653
</para>
15649-
15654+
<indexterm>
15655+
<primary>pgpro_version</primary>
15656+
</indexterm>
15657+
<para>
15658+
<literal><function>pgpro_version()</function></literal>
15659+
returns a string, describing <productname>PostgresPro</> version
15660+
information.</para>
1565015661
<indexterm>
1565115662
<primary>privilege</primary>
1565215663
<secondary>querying</secondary>

src/backend/utils/adt/version.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ pgsql_version(PG_FUNCTION_ARGS)
2222
{
2323
PG_RETURN_TEXT_P(cstring_to_text(PG_VERSION_STR));
2424
}
25+
26+
Datum
27+
pgpro_version(PG_FUNCTION_ARGS)
28+
{
29+
PG_RETURN_TEXT_P(cstring_to_text(PGPRO_VERSION_STR));
30+
}

src/include/catalog/pg_proc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5303,6 +5303,11 @@ DESCR("get an individual replication origin's replication progress");
53035303
DATA(insert OID = 6014 ( pg_show_replication_origin_status PGNSP PGUID 12 1 100 0 0 f f f f f t v r 0 0 2249 "" "{26,25,3220,3220}" "{o,o,o,o}" "{local_id, external_id, remote_lsn, local_lsn}" _null_ _null_ pg_show_replication_origin_status _null_ _null_ _null_ ));
53045304
DESCR("get progress for all replication origins");
53055305

5306+
/* pgpro version */
5307+
DATA(insert OID = 6015 ( pgpro_version PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 25 "" _null_ _null_ _null_ _null_ _null_ pgpro_version _null_ _null_ _null_ ));
5308+
DESCR("PostgresPro version string");
5309+
5310+
53065311
/* rls */
53075312
DATA(insert OID = 3298 ( row_security_active PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 16 "26" _null_ _null_ _null_ _null_ _null_ row_security_active _null_ _null_ _null_ ));
53085313
DESCR("row security for current context active on table by table oid");

src/include/pg_config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,12 @@
751751
/* A string containing the version number, platform, and C compiler */
752752
#undef PG_VERSION_STR
753753

754+
/* PostgresPRo version as a string */
755+
#undef PGPRO_VERSION
756+
757+
/* A string containing the version number of Postgres Pro */
758+
#undef PGPRO_VERSION_STR
759+
754760
/* Define to 1 to allow profiling output to be saved separately for each
755761
process. */
756762
#undef PROFILE_PID_DIR

src/include/utils/builtins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ extern Datum text_format_nv(PG_FUNCTION_ARGS);
891891

892892
/* version.c */
893893
extern Datum pgsql_version(PG_FUNCTION_ARGS);
894+
extern Datum pgpro_version(PG_FUNCTION_ARGS);
894895

895896
/* xid.c */
896897
extern Datum xidin(PG_FUNCTION_ARGS);

0 commit comments

Comments
 (0)