File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,12 @@ impl Dialect for RedshiftSqlDialect {
4444 }
4545
4646 fn is_identifier_start ( & self , ch : char ) -> bool {
47- PostgreSqlDialect { } . is_identifier_start ( ch)
47+ // Extends Postgres dialect with sharp
48+ PostgreSqlDialect { } . is_identifier_start ( ch) || ch == '#'
4849 }
4950
5051 fn is_identifier_part ( & self , ch : char ) -> bool {
51- PostgreSqlDialect { } . is_identifier_part ( ch)
52+ // Extends Postgres dialect with sharp
53+ PostgreSqlDialect { } . is_identifier_part ( ch) || ch == '#'
5254 }
5355}
Original file line number Diff line number Diff line change @@ -100,3 +100,13 @@ fn redshift() -> TestedDialects {
100100 dialects : vec ! [ Box :: new( RedshiftSqlDialect { } ) ] ,
101101 }
102102}
103+
104+ #[ test]
105+ fn test_sharp ( ) {
106+ let sql = "SELECT #_of_values" ;
107+ let select = redshift ( ) . verified_only_select ( sql) ;
108+ assert_eq ! (
109+ SelectItem :: UnnamedExpr ( Expr :: Identifier ( Ident :: new( "#_of_values" ) ) ) ,
110+ select. projection[ 0 ]
111+ ) ;
112+ }
You can’t perform that action at this time.
0 commit comments