PLPROXY_SQL += plproxy_fdw.sql
endif
-REGRESS_OPTS = --load-language=plpgsql
+REGRESS_OPTS = --dbname=regression
# load PGXS makefile
PGXS = $(shell pg_config --pgxs)
set client_min_messages = 'warning';
drop database if exists test_enc_proxy;
drop database if exists test_enc_part;
-create database test_enc_proxy with encoding 'euc_jp';
-create database test_enc_part with encoding 'utf-8';
+create database test_enc_proxy with encoding 'euc_jp' template template0;
+create database test_enc_part with encoding 'utf-8' template template0;
-- initialize proxy db
\c test_enc_proxy
set client_min_messages = 'warning';
set client_encoding = 'utf-8';
drop language if exists plpgsql;
create language plpgsql;
-\i plproxy.sql
--- handler function
-CREATE FUNCTION plproxy_call_handler ()
-RETURNS language_handler AS '$libdir/plproxy' LANGUAGE C;
--- language
-CREATE LANGUAGE plproxy HANDLER plproxy_call_handler;
+\set ECHO none
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
returns integer as $$ begin return 1; end; $$ language plpgsql;
set client_min_messages = 'warning';
drop database if exists test_enc_proxy;
drop database if exists test_enc_part;
-create database test_enc_proxy with encoding 'utf-8';
-create database test_enc_part with encoding 'euc_jp';
+create database test_enc_proxy with encoding 'utf-8' template template0;
+create database test_enc_part with encoding 'euc_jp' template template0;
-- initialize proxy db
\c test_enc_proxy
set client_min_messages = 'warning';
drop language if exists plpgsql;
create language plpgsql;
-\i plproxy.sql
--- handler function
-CREATE FUNCTION plproxy_call_handler ()
-RETURNS language_handler AS '$libdir/plproxy' LANGUAGE C;
--- language
-CREATE LANGUAGE plproxy HANDLER plproxy_call_handler;
+\set ECHO none
set client_encoding = 'utf8';
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
create function test_types(username text, inout vbool boolean, inout xdate timestamp, inout bin bytea)
as $$ begin return; end; $$ language plpgsql;
\c regression
+select 1 from (select set_config(name, 'escape', false) as ignore
+ from pg_settings where name = 'bytea_output') x
+where x.ignore = 'foo';
+ ?column?
+----------
+(0 rows)
+
select * from test_types('types', true, '2009-11-04 12:12:02', E'a\\000\\001\\002b');
vbool | xdate | bin
-------+--------------------------+----------------
set client_min_messages = 'warning';
drop database if exists test_enc_proxy;
drop database if exists test_enc_part;
-create database test_enc_proxy with encoding 'euc_jp';
-create database test_enc_part with encoding 'utf-8';
+create database test_enc_proxy with encoding 'euc_jp' template template0;
+create database test_enc_part with encoding 'utf-8' template template0;
-- initialize proxy db
\c test_enc_proxy
set client_encoding = 'utf-8';
drop language if exists plpgsql;
create language plpgsql;
+\set ECHO none
\i plproxy.sql
+\set ECHO all
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
returns integer as $$ begin return 1; end; $$ language plpgsql;
set client_min_messages = 'warning';
drop database if exists test_enc_proxy;
drop database if exists test_enc_part;
-create database test_enc_proxy with encoding 'utf-8';
-create database test_enc_part with encoding 'euc_jp';
+create database test_enc_proxy with encoding 'utf-8' template template0;
+create database test_enc_part with encoding 'euc_jp' template template0;
-- initialize proxy db
\c test_enc_proxy
set client_min_messages = 'warning';
drop language if exists plpgsql;
create language plpgsql;
+\set ECHO none
\i plproxy.sql
+\set ECHO all
set client_encoding = 'utf8';
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
\i plproxy.sql
+drop language if exists plpgsql;
+create language plpgsql;
+
-- create cluster info functions
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
\c test_part
create function test_types(username text, inout vbool boolean, inout xdate timestamp, inout bin bytea)
as $$ begin return; end; $$ language plpgsql;
+
\c regression
+select 1 from (select set_config(name, 'escape', false) as ignore
+ from pg_settings where name = 'bytea_output') x
+where x.ignore = 'foo';
select * from test_types('types', true, '2009-11-04 12:12:02', E'a\\000\\001\\002b');
select * from test_types('types', NULL, NULL, NULL);