Skip to content

Commit

Permalink
Add point, complex, abstime & reltime data for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robozmey committed Dec 5, 2024
1 parent 857a208 commit 2ccfde5
Show file tree
Hide file tree
Showing 8 changed files with 739 additions and 8 deletions.
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions contrib/try_convert/data/tt_point.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(1, 2)
(-100000, 0)
21, 9999999999
0.011111, 9
962856498.3423, -243.24
3321, 123
23,12
1321 , 132
216 ,345354
( 21, 9999999999 )
( 0.011111, 9 )
( 962856498.3423, -243.24 )
(3321, 123 )
( 23,12)
(1321 , 132 )
( 216 ,345354)
Empty file.
21 changes: 17 additions & 4 deletions contrib/try_convert/generate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,45 @@
'float8',
'float4',
'numeric',
'complex',

'bool',

'bit', # BITSTRING
'varbit',

'date', # TIME
'time',
'timetz',
'timestamp',
'timestamptz',
'interval',
# 'box', # GEOMENTY
'abstime',
'reltime',

'point', # GEOMENTY
# 'circle',
# 'line',
# 'lseg',
# 'path',
# 'point',
# 'box',
# 'polygon',

'cidr', # IP
'inet',
'macaddr',
'json', # JSON

'json', # OBJ
'jsonb',
'xml',
# 'bytea',

# 'bytea',

'char', # STRINGS
# 'bpchar',
'varchar',
'text',

'money',
# # 'pg_lsn',
# # 'tsquery',
Expand Down Expand Up @@ -79,6 +91,7 @@ def get_typemod_table(t, l):
uncomparable_types = [
'json',
'xml',
'point',
]

extensions = [
Expand Down
248 changes: 246 additions & 2 deletions contrib/try_convert/input/try_convert.source

Large diffs are not rendered by default.

456 changes: 454 additions & 2 deletions contrib/try_convert/output/try_convert.source

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions contrib/try_convert/try_convert--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ select add_type_for_try_convert('int8'::regtype);
select add_type_for_try_convert('float4'::regtype);
select add_type_for_try_convert('float8'::regtype);
select add_type_for_try_convert('numeric'::regtype);
select add_type_for_try_convert('complex'::regtype);

-- TIME
select add_type_for_try_convert('date'::regtype);
Expand All @@ -58,6 +59,8 @@ select add_type_for_try_convert('timetz'::regtype);
select add_type_for_try_convert('timestamp'::regtype);
select add_type_for_try_convert('timestamptz'::regtype);
select add_type_for_try_convert('interval'::regtype);
select add_type_for_try_convert('abstime'::regtype);
select add_type_for_try_convert('reltime'::regtype);

-- CHARACTER
select add_type_for_try_convert('char'::regtype);
Expand All @@ -75,6 +78,9 @@ select add_type_for_try_convert('money'::regtype);

select add_type_for_try_convert('uuid'::regtype);

-- GEOMETRY
select add_type_for_try_convert('point'::regtype);

-- IP/MAC
select add_type_for_try_convert('cidr'::regtype);
select add_type_for_try_convert('inet'::regtype);
Expand Down

0 comments on commit 2ccfde5

Please sign in to comment.