Table	Create Table
t1	CREATE TABLE `t1` (
  `Name` varchar(256) NOT NULL,
  `Description` varchar(256) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
SET NAMES utf8;
#
# Checking CATFUNC=Tables
#

# All tables in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables;
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	public	t2	TABLE	
mtr	public	v1	VIEW	
mtr	schema1	t1	TABLE	
mtr	schema1	t2	TABLE	
mtr	schema1	v1	VIEW	
DROP TABLE t1;
# All tables in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.%.%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	public	t2	TABLE	
mtr	public	v1	VIEW	
mtr	schema1	t1	TABLE	
mtr	schema1	t2	TABLE	
mtr	schema1	v1	VIEW	
DROP TABLE t1;
# All tables in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	public	t2	TABLE	
mtr	public	v1	VIEW	
mtr	schema1	t1	TABLE	
mtr	schema1	t2	TABLE	
mtr	schema1	v1	VIEW	
DROP TABLE t1;
# All tables in the default schema ("public")
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	public	t2	TABLE	
mtr	public	v1	VIEW	
DROP TABLE t1;
# All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	schema1	t1	TABLE	
DROP TABLE t1;
# All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	schema1	t1	TABLE	
DROP TABLE t1;
# Table "t1" in the default schema ("public")
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
DROP TABLE t1;
# Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.public.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
DROP TABLE t1;
# Table "t1" in the schema "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='%.schema1.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	schema1	t1	TABLE	
DROP TABLE t1;
# All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Tables TABNAME='xxx.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Table_Type	Remark
mtr	public	t1	TABLE	
mtr	schema1	t1	TABLE	
DROP TABLE t1;
#
# Checking CATFUNC=Columns
#

# All columns in the schemas "public" and "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns;
SELECT * FROM t1 WHERE Table_Schema IN ('public','schema1') ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	public	t1	a	4	int4	10	4	0	10	0	
mtr	public	t2	a	4	int4	10	4	0	10	0	
mtr	public	v1	a	4	int4	10	4	0	10	1	
mtr	schema1	t1	a	1	bpchar	10	60	0	0	0	
mtr	schema1	t2	a	1	bpchar	10	60	0	0	0	
mtr	schema1	v1	a	1	bpchar	10	60	0	0	1	
DROP TABLE t1;
# All columns in the schemas "public" and "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%';
SELECT * FROM t1 WHERE Table_Schema IN ('public','schema1') ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	public	t1	a	4	int4	10	4	0	10	0	
mtr	public	t2	a	4	int4	10	4	0	10	0	
mtr	public	v1	a	4	int4	10	4	0	10	1	
mtr	schema1	t1	a	1	bpchar	10	60	0	0	0	
mtr	schema1	t2	a	1	bpchar	10	60	0	0	0	
mtr	schema1	v1	a	1	bpchar	10	60	0	0	1	
DROP TABLE t1;
# All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	public	t1	a	4	int4	10	4	0	10	0	
mtr	schema1	t1	a	1	bpchar	10	60	0	0	0	
DROP TABLE t1;
# Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	public	t1	a	4	int4	10	4	0	10	0	
DROP TABLE t1;
# Table "t1" in the schema "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	schema1	t1	a	1	bpchar	10	60	0	0	0	
DROP TABLE t1;
# All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat	Table_Schema	Table_Name	Column_Name	Data_Type	Type_Name	Column_Size	Buffer_Length	Decimal_Digits	Radix	Nullable	Remarks
mtr	public	t1	a	4	int4	10	4	0	10	0	
mtr	schema1	t1	a	1	bpchar	10	60	0	0	0	
DROP TABLE t1;
#
# Checking tables
#

# Table "t1" in the default schema ("public")
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr';
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC'
SELECT * FROM t1;
a
10
20
30
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` int(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
10
20
30
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
a
10
20
30
DROP VIEW v1;
DROP TABLE t1;
# Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABNAME='public.t1' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr';
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='public.t1'
SELECT * FROM t1;
a
10
20
30
DROP TABLE t1;
# Table "t1" in the schema "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABNAME='schema1.t1' CHARSET=utf8 DATA_CHARSET=utf8 TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr';
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t1' `DATA_CHARSET`='utf8'
SELECT * FROM t1;
a
aaa
bbb
ccc
яяя
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` char(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
aaa
bbb
ccc
яяя
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
a
aaa
bbb
ccc
яяя
DROP VIEW v1;
DROP TABLE t1;
# View "v1" in the schema "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABNAME='schema1.v1' CHARSET=utf8 DATA_CHARSET=utf8 TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr';
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.v1' `DATA_CHARSET`='utf8'
SELECT * FROM t1;
a
aaa
bbb
ccc
яяя
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` char(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
aaa
bbb
ccc
яяя
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
a
aaa
bbb
ccc
яяя
DROP VIEW v1;
DROP TABLE t1;
# Table "t2" in the schema "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABNAME='schema1.t2' CHARSET=utf8 DATA_CHARSET=utf8 TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr';
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='schema1.t2' `DATA_CHARSET`='utf8'
SELECT * FROM t1;
a
xxx
yyy
zzz
ÄÖÜ
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` char(10) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
xxx
yyy
zzz
ÄÖÜ
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
a
xxx
yyy
zzz
ÄÖÜ
DROP VIEW v1;
DROP TABLE t1;
