Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 70a3c18

Browse files
committed
Merge branch 'PGPRO10' into PGPROEE10
2 parents 4c8b55e + 63b59e5 commit 70a3c18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2248
-1608
lines changed

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 10.2.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 10.3.
44
#
55
# Report bugs to <bugs@postgrespro.ru>.
66
#
@@ -583,8 +583,8 @@ MAKEFLAGS=
583583
# Identity of this package.
584584
PACKAGE_NAME='PostgreSQL'
585585
PACKAGE_TARNAME='postgrespro'
586-
PACKAGE_VERSION='10.2'
587-
PACKAGE_STRING='PostgreSQL 10.2'
586+
PACKAGE_VERSION='10.3'
587+
PACKAGE_STRING='PostgreSQL 10.3'
588588
PACKAGE_BUGREPORT='bugs@postgrespro.ru'
589589
PACKAGE_URL=''
590590

@@ -1431,7 +1431,7 @@ if test "$ac_init_help" = "long"; then
14311431
# Omit some internal or obsolete options to make the list less imposing.
14321432
# This message is too long to be a string in the A/UX 3.1 sh.
14331433
cat <<_ACEOF
1434-
\`configure' configures PostgreSQL 10.2 to adapt to many kinds of systems.
1434+
\`configure' configures PostgreSQL 10.3 to adapt to many kinds of systems.
14351435
14361436
Usage: $0 [OPTION]... [VAR=VALUE]...
14371437
@@ -1497,7 +1497,7 @@ fi
14971497

14981498
if test -n "$ac_init_help"; then
14991499
case $ac_init_help in
1500-
short | recursive ) echo "Configuration of PostgreSQL 10.2:";;
1500+
short | recursive ) echo "Configuration of PostgreSQL 10.3:";;
15011501
esac
15021502
cat <<\_ACEOF
15031503
@@ -1658,7 +1658,7 @@ fi
16581658
test -n "$ac_init_help" && exit $ac_status
16591659
if $ac_init_version; then
16601660
cat <<\_ACEOF
1661-
PostgreSQL configure 10.2
1661+
PostgreSQL configure 10.3
16621662
generated by GNU Autoconf 2.69
16631663
16641664
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2370,7 +2370,7 @@ cat >config.log <<_ACEOF
23702370
This file contains any messages produced by compilers while
23712371
running configure, to aid debugging if configure makes a mistake.
23722372
2373-
It was created by PostgreSQL $as_me 10.2, which was
2373+
It was created by PostgreSQL $as_me 10.3, which was
23742374
generated by GNU Autoconf 2.69. Invocation command line was
23752375
23762376
$ $0 $@
@@ -17727,7 +17727,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1772717727
# report actual input values of CONFIG_FILES etc. instead of their
1772817728
# values after options handling.
1772917729
ac_log="
17730-
This file was extended by PostgreSQL $as_me 10.2, which was
17730+
This file was extended by PostgreSQL $as_me 10.3, which was
1773117731
generated by GNU Autoconf 2.69. Invocation command line was
1773217732
1773317733
CONFIG_FILES = $CONFIG_FILES
@@ -17797,7 +17797,7 @@ _ACEOF
1779717797
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1779817798
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1779917799
ac_cs_version="\\
17800-
PostgreSQL config.status 10.2
17800+
PostgreSQL config.status 10.3
1780117801
configured by $0, generated by GNU Autoconf 2.69,
1780217802
with options \\"\$ac_cs_config\\"
1780317803

configure.in

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

20-
AC_INIT([PostgreSQL], [10.2], [bugs@postgrespro.ru], [postgrespro])
20+
AC_INIT([PostgreSQL], [10.3], [bugs@postgrespro.ru], [postgrespro])
2121
PACKAGE_TARNAME=postgrespro-enterprise
2222

2323
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.

contrib/oid2name/oid2name.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "catalog/pg_class.h"
1313

14+
#include "fe_utils/connect.h"
1415
#include "libpq-fe.h"
1516
#include "pg_getopt.h"
1617

@@ -266,6 +267,7 @@ sql_conn(struct options *my_opts)
266267
bool have_password = false;
267268
char password[100];
268269
bool new_pass;
270+
PGresult *res;
269271

270272
/*
271273
* Start the connection. Loop until we have a password if requested by
@@ -323,6 +325,17 @@ sql_conn(struct options *my_opts)
323325
exit(1);
324326
}
325327

328+
res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
329+
if (PQresultStatus(res) != PGRES_TUPLES_OK)
330+
{
331+
fprintf(stderr, "oid2name: could not clear search_path: %s\n",
332+
PQerrorMessage(conn));
333+
PQclear(res);
334+
PQfinish(conn);
335+
exit(-1);
336+
}
337+
PQclear(res);
338+
326339
/* return the conn if good */
327340
return conn;
328341
}

contrib/vacuumlo/vacuumlo.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "catalog/pg_class.h"
2525

26+
#include "fe_utils/connect.h"
2627
#include "libpq-fe.h"
2728
#include "pg_getopt.h"
2829

@@ -140,11 +141,8 @@ vacuumlo(const char *database, const struct _param *param)
140141
fprintf(stdout, "Test run: no large objects will be removed!\n");
141142
}
142143

143-
/*
144-
* Don't get fooled by any non-system catalogs
145-
*/
146-
res = PQexec(conn, "SET search_path = pg_catalog");
147-
if (PQresultStatus(res) != PGRES_COMMAND_OK)
144+
res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
145+
if (PQresultStatus(res) != PGRES_TUPLES_OK)
148146
{
149147
fprintf(stderr, "Failed to set search_path:\n");
150148
fprintf(stderr, "%s", PQerrorMessage(conn));

doc/bug.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ System Configuration:
2727

2828
Operating System (example: Linux 2.4.18) :
2929

30-
PostgreSQL version (example: PostgreSQL 10.2): PostgreSQL 10.2
30+
PostgreSQL version (example: PostgreSQL 10.3): PostgreSQL 10.3
3131

3232
Compiler used (example: gcc 3.3.5) :
3333

doc/src/sgml/config.sgml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6255,6 +6255,13 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
62556255
setting, either globally or per-user.
62566256
</para>
62576257

6258+
<para>
6259+
For more information on schema handling, see
6260+
<xref linkend="ddl-schemas">. In particular, the default
6261+
configuration is suitable only when the database has a single user or
6262+
a few mutually-trusting users.
6263+
</para>
6264+
62586265
<para>
62596266
The current effective value of the search path can be examined
62606267
via the <acronym>SQL</acronym> function
@@ -6265,10 +6272,6 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
62656272
<function>current_schemas</> shows how the items
62666273
appearing in <varname>search_path</varname> were resolved.
62676274
</para>
6268-
6269-
<para>
6270-
For more information on schema handling, see <xref linkend="ddl-schemas">.
6271-
</para>
62726275
</listitem>
62736276
</varlistentry>
62746277

doc/src/sgml/contrib.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ CREATE EXTENSION <replaceable>module_name</>;
7474
choice. To do that, add <literal>SCHEMA
7575
<replaceable>schema_name</></literal> to the <command>CREATE EXTENSION</>
7676
command. By default, the objects will be placed in your current creation
77-
target schema, typically <literal>public</>.
77+
target schema, which in turn defaults to <literal>public</>.
7878
</para>
7979

8080
<para>

doc/src/sgml/dblink.sgml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ dblink_connect(text connname, text connstr) returns text
8383
<listitem>
8484
<para><application>libpq</>-style connection info string, for example
8585
<literal>hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres
86-
password=mypasswd</>.
86+
password=mypasswd options=-csearch_path=</>.
8787
For details see <xref linkend="libpq-connstring">.
8888
Alternatively, the name of a foreign server.
8989
</para>
@@ -104,6 +104,17 @@ dblink_connect(text connname, text connstr) returns text
104104
<refsect1>
105105
<title>Notes</title>
106106

107+
<para>
108+
If untrusted users have access to a database that has not adopted a
109+
<link linkend="ddl-schemas-patterns">secure schema usage pattern</link>,
110+
begin each session by removing publicly-writable schemas from
111+
<varname>search_path</varname>. One could, for example,
112+
add <literal>options=-csearch_path=</literal> to
113+
<parameter>connstr</parameter>. This consideration is not specific
114+
to <filename>dblink</filename>; it applies to every interface for
115+
executing arbitrary SQL commands.
116+
</para>
117+
107118
<para>
108119
Only superusers may use <function>dblink_connect</> to create
109120
non-password-authenticated connections. If non-superusers need this
@@ -121,13 +132,13 @@ dblink_connect(text connname, text connstr) returns text
121132
<title>Examples</title>
122133

123134
<screen>
124-
SELECT dblink_connect('dbname=postgres');
135+
SELECT dblink_connect('dbname=postgres options=-csearch_path=');
125136
dblink_connect
126137
----------------
127138
OK
128139
(1 row)
129140

130-
SELECT dblink_connect('myconn', 'dbname=postgres');
141+
SELECT dblink_connect('myconn', 'dbname=postgres options=-csearch_path=');
131142
dblink_connect
132143
----------------
133144
OK
@@ -416,7 +427,8 @@ dblink(text sql [, bool fail_on_error]) returns setof record
416427

417428
<programlisting>
418429
SELECT *
419-
FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc')
430+
FROM dblink('dbname=mydb options=-csearch_path=',
431+
'select proname, prosrc from pg_proc')
420432
AS t1(proname name, prosrc text)
421433
WHERE proname LIKE 'bytea%';
422434
</programlisting>
@@ -450,7 +462,8 @@ SELECT *
450462
<programlisting>
451463
CREATE VIEW myremote_pg_proc AS
452464
SELECT *
453-
FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc')
465+
FROM dblink('dbname=postgres options=-csearch_path=',
466+
'select proname, prosrc from pg_proc')
454467
AS t1(proname name, prosrc text);
455468

456469
SELECT * FROM myremote_pg_proc WHERE proname LIKE 'bytea%';
@@ -461,7 +474,8 @@ SELECT * FROM myremote_pg_proc WHERE proname LIKE 'bytea%';
461474
<title>Examples</title>
462475

463476
<screen>
464-
SELECT * FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc')
477+
SELECT * FROM dblink('dbname=postgres options=-csearch_path=',
478+
'select proname, prosrc from pg_proc')
465479
AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%';
466480
proname | prosrc
467481
------------+------------
@@ -479,7 +493,7 @@ SELECT * FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc')
479493
byteaout | byteaout
480494
(12 rows)
481495

482-
SELECT dblink_connect('dbname=postgres');
496+
SELECT dblink_connect('dbname=postgres options=-csearch_path=');
483497
dblink_connect
484498
----------------
485499
OK
@@ -503,7 +517,7 @@ SELECT * FROM dblink('select proname, prosrc from pg_proc')
503517
byteaout | byteaout
504518
(12 rows)
505519

506-
SELECT dblink_connect('myconn', 'dbname=regression');
520+
SELECT dblink_connect('myconn', 'dbname=regression options=-csearch_path=');
507521
dblink_connect
508522
----------------
509523
OK
@@ -778,7 +792,7 @@ dblink_open(text connname, text cursorname, text sql [, bool fail_on_error]) ret
778792
<title>Examples</title>
779793

780794
<screen>
781-
SELECT dblink_connect('dbname=postgres');
795+
SELECT dblink_connect('dbname=postgres options=-csearch_path=');
782796
dblink_connect
783797
----------------
784798
OK
@@ -899,7 +913,7 @@ dblink_fetch(text connname, text cursorname, int howmany [, bool fail_on_error])
899913
<title>Examples</title>
900914

901915
<screen>
902-
SELECT dblink_connect('dbname=postgres');
916+
SELECT dblink_connect('dbname=postgres options=-csearch_path=');
903917
dblink_connect
904918
----------------
905919
OK
@@ -1036,7 +1050,7 @@ dblink_close(text connname, text cursorname [, bool fail_on_error]) returns text
10361050
<title>Examples</title>
10371051

10381052
<screen>
1039-
SELECT dblink_connect('dbname=postgres');
1053+
SELECT dblink_connect('dbname=postgres options=-csearch_path=');
10401054
dblink_connect
10411055
----------------
10421056
OK

0 commit comments

Comments
 (0)