@@ -206,6 +206,23 @@ type checking should allow us to give type errors without the user having to run
206206
207207support more advanced lint rules
208208
209+ #### type check ` create type t as range `
210+
211+ ``` sql
212+ create type timerange as range (
213+ subtype = time ,
214+ subtype_diff = time_subtype_diff
215+ );
216+ ```
217+
218+ if set, ` subtype_diff ` must be of type ` function time_subtype_diff(time without time zone, time without time zone) `
219+
220+ ``` ts
221+ function createRangeType<T >(subtype : T , subtype_diff : (T , T ) => float8 )
222+ ```
223+
224+ https :// www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-DEFINING
225+
209226### PGO
210227
211228- https :// github.com/rust-lang/rust-analyzer/pull/19582#issue-2992471459
@@ -590,6 +607,26 @@ select '{"foo": 1,}'::json;
590607-- ^ invalid json, unexpected trailing comma
591608` ` `
592609
610+ ` ` ` sql
611+ create type foo as (
612+ a int8,
613+ b int8
614+ );
615+ select foo '(1)';
616+ -- ^ malformed record literal, missing column b
617+ ` ` `
618+
619+ ` ` ` sql
620+ select '[1,,2)'::numrange;
621+ -- ^ malformed range literal, extra comma
622+
623+ create table reservation (room int, during tsrange);
624+ insert into reservation values
625+ (1108, '[2010-01-01 14:30,, 2010-01-01 15:30)');
626+ -- ^ malformed range literal, extra comma
627+
628+ ` ` `
629+
593630### Rule : column label is the same as an existing column
594631
595632` ` ` sql
@@ -772,6 +809,18 @@ select * from json_table(
772809);
773810` ` `
774811
812+ #### ` nextval `
813+
814+ ` ` ` sql
815+ -- via https :// www.postgresql.org/docs/current/datatype-oid.html
816+ nextval (' foo' ) -- operates on sequence foo
817+ nextval (' FOO' ) -- same as above
818+ nextval (' "Foo"' ) -- operates on sequence Foo
819+ nextval (' myschema.foo' ) -- operates on myschema .foo
820+ nextval (' "myschema".foo' ) -- same as above
821+ nextval (' foo' ) -- searches search path for foo
822+ ` ` `
823+
775824### Autocomplete
776825
777826- [datagrip postfix completion](https://blog.jetbrains.com/datagrip/2019/03/11/top-9-sql-features-of-datagrip-you-have-to-know/#postfix_completion)
0 commit comments