Skip to content

Commit 0e6e7f0

Browse files
committed
Merge dblink's paths test script into its main test.
There's no longer any reason to fire up a separate psql run to create these functions. (Some refactoring in the main regression tests is also called for, but that will take more thought.) Discussion: https://postgr.es/m/1655733.1639871614@sss.pgh.pa.us
1 parent dc9c3b0 commit 0e6e7f0

File tree

5 files changed

+42
-42
lines changed

5 files changed

+42
-42
lines changed

contrib/dblink/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EXTENSION = dblink
1111
DATA = dblink--1.2.sql dblink--1.1--1.2.sql dblink--1.0--1.1.sql
1212
PGFILEDESC = "dblink - connect to other PostgreSQL databases"
1313

14-
REGRESS = paths dblink
14+
REGRESS = dblink
1515
REGRESS_OPTS = --dlpath=$(top_builddir)/src/test/regress
1616

1717
ifdef USE_PGXS

contrib/dblink/expected/dblink.out

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
CREATE EXTENSION dblink;
2+
-- directory paths and dlsuffix are passed to us in environment variables
3+
\getenv abs_srcdir PG_ABS_SRCDIR
4+
\getenv libdir PG_LIBDIR
5+
\getenv dlsuffix PG_DLSUFFIX
6+
\set regresslib :libdir '/regress' :dlsuffix
7+
-- create some functions needed for tests
8+
CREATE FUNCTION setenv(text, text)
9+
RETURNS void
10+
AS :'regresslib', 'regress_setenv'
11+
LANGUAGE C STRICT;
12+
CREATE FUNCTION wait_pid(int)
13+
RETURNS void
14+
AS :'regresslib'
15+
LANGUAGE C STRICT;
16+
\set path :abs_srcdir '/'
17+
\set fnbody 'SELECT setenv(''PGSERVICEFILE'', ' :'path' ' || $1)'
18+
CREATE FUNCTION set_pgservicefile(text) RETURNS void LANGUAGE SQL
19+
AS :'fnbody';
220
-- want context for notices
321
\set SHOW_CONTEXT always
422
CREATE TABLE foo(f1 int, f2 text, f3 text[], primary key (f1,f2));

contrib/dblink/expected/paths.out

Lines changed: 0 additions & 18 deletions
This file was deleted.

contrib/dblink/sql/dblink.sql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
CREATE EXTENSION dblink;
22

3+
-- directory paths and dlsuffix are passed to us in environment variables
4+
\getenv abs_srcdir PG_ABS_SRCDIR
5+
\getenv libdir PG_LIBDIR
6+
\getenv dlsuffix PG_DLSUFFIX
7+
8+
\set regresslib :libdir '/regress' :dlsuffix
9+
10+
-- create some functions needed for tests
11+
CREATE FUNCTION setenv(text, text)
12+
RETURNS void
13+
AS :'regresslib', 'regress_setenv'
14+
LANGUAGE C STRICT;
15+
16+
CREATE FUNCTION wait_pid(int)
17+
RETURNS void
18+
AS :'regresslib'
19+
LANGUAGE C STRICT;
20+
21+
\set path :abs_srcdir '/'
22+
\set fnbody 'SELECT setenv(''PGSERVICEFILE'', ' :'path' ' || $1)'
23+
CREATE FUNCTION set_pgservicefile(text) RETURNS void LANGUAGE SQL
24+
AS :'fnbody';
25+
326
-- want context for notices
427
\set SHOW_CONTEXT always
528

contrib/dblink/sql/paths.sql

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy