File: multicorn_test_date.sql

package info (click to toggle)
postgresql-multicorn 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,164 kB
  • ctags: 709
  • sloc: ansic: 3,236; python: 2,227; sql: 755; makefile: 264; sh: 29
file content (23 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SET client_min_messages=NOTICE;
CREATE EXTENSION multicorn;
CREATE server multicorn_srv foreign data wrapper multicorn options (
    wrapper 'multicorn.testfdw.TestForeignDataWrapper'
);
CREATE user mapping for postgres server multicorn_srv options (usermapping 'test');

CREATE foreign table testmulticorn (
    test1 date,
    test2 timestamp
) server multicorn_srv options (
    option1 'option1',
    test_type 'date'
);

-- Test "normal" usage
select * from testmulticorn;

select * from testmulticorn where test1 < '2011-06-01';

select * from testmulticorn where test2 < '2011-06-01 00:00:00';
DROP USER MAPPING FOR postgres SERVER multicorn_srv;
DROP EXTENSION multicorn cascade;