QuackatronHQ / Gigarepo

Keyword used as an identifier SQL-L029
Bug risk
Major
31 occurrences in this check
Keywords should not be used as identifiers
14  a+(b*c), (a+b)*c             -- ditto
15
16
17INSERT INTO mnop (m, n) SELECT i, (1e9 + i/2e4)::float FROM generate_series(1, 2e4) AS i(i) RETURNING NOTHING18
19CREATE TABLE midprimarykeyswapcleanup AS SELECT * FROM generate_series(1,3) AS a;
20-- This schema change is used to enable the primary key swap. The backup is not taken during this schema change.
Keywords should not be used as identifiers
1select sum(a) over w, avg(b) over (partition by c order by d rows e preceding), min(f) over (order by g range between unbounded preceding and h following exclude ties) from t window w as (partition by i groups between j preceding and current row exclude no others)
Keywords should not be used as identifiers
1select sum(a) over w, avg(b) over (partition by c order by d rows e preceding), min(f) over (order by g range between unbounded preceding and h following exclude ties) from t window w as (partition by i groups between j preceding and current row exclude no others)
Keywords should not be used as identifiers
186
187ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_orders FOREIGN KEY (l_orderkey) references orders (o_orderkey);
188ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_part FOREIGN KEY (l_partkey) references part (p_partkey);
189ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_supplier FOREIGN KEY (l_suppkey) references supplier (s_suppkey);
Keywords should not be used as identifiers
185) WITH delimiter='|';
186
187ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_orders FOREIGN KEY (l_orderkey) references orders (o_orderkey);
188ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_part FOREIGN KEY (l_partkey) references part (p_partkey);189ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_supplier FOREIGN KEY (l_suppkey) references supplier (s_suppkey);
Keywords should not be used as identifiers
184  'gs://sf-10/lineitem.tbl.8'
185) WITH delimiter='|';
186
187ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_orders FOREIGN KEY (l_orderkey) references orders (o_orderkey);188ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_part FOREIGN KEY (l_partkey) references part (p_partkey);
189ALTER TABLE lineitem ADD CONSTRAINT lineitem_fkey_supplier FOREIGN KEY (l_suppkey) references supplier (s_suppkey);
Keywords should not be used as identifiers
170  INDEX l_cd      (l_commitdate ASC),
171  INDEX l_rd      (l_receiptdate ASC),
172  INDEX l_pk_sk   (l_partkey ASC, l_suppkey ASC),
173  INDEX l_sk_pk   (l_suppkey ASC, l_partkey ASC)174);
175
176IMPORT INTO lineitem CSV DATA(
Keywords should not be used as identifiers
169  INDEX l_sd      (l_shipdate ASC),
170  INDEX l_cd      (l_commitdate ASC),
171  INDEX l_rd      (l_receiptdate ASC),
172  INDEX l_pk_sk   (l_partkey ASC, l_suppkey ASC),173  INDEX l_sk_pk   (l_suppkey ASC, l_partkey ASC)
174);
175
Keywords should not be used as identifiers
168  INDEX l_sk      (l_suppkey ASC),
169  INDEX l_sd      (l_shipdate ASC),
170  INDEX l_cd      (l_commitdate ASC),
171  INDEX l_rd      (l_receiptdate ASC),172  INDEX l_pk_sk   (l_partkey ASC, l_suppkey ASC),
173  INDEX l_sk_pk   (l_suppkey ASC, l_partkey ASC)
174);
Keywords should not be used as identifiers
167  INDEX l_pk      (l_partkey ASC),
168  INDEX l_sk      (l_suppkey ASC),
169  INDEX l_sd      (l_shipdate ASC),
170  INDEX l_cd      (l_commitdate ASC),171  INDEX l_rd      (l_receiptdate ASC),
172  INDEX l_pk_sk   (l_partkey ASC, l_suppkey ASC),
173  INDEX l_sk_pk   (l_suppkey ASC, l_partkey ASC)
Keywords should not be used as identifiers
166  INDEX l_ok      (l_orderkey ASC),
167  INDEX l_pk      (l_partkey ASC),
168  INDEX l_sk      (l_suppkey ASC),
169  INDEX l_sd      (l_shipdate ASC),170  INDEX l_cd      (l_commitdate ASC),
171  INDEX l_rd      (l_receiptdate ASC),
172  INDEX l_pk_sk   (l_partkey ASC, l_suppkey ASC),
Keywords should not be used as identifiers
165  PRIMARY KEY     (l_orderkey, l_linenumber),
166  INDEX l_ok      (l_orderkey ASC),
167  INDEX l_pk      (l_partkey ASC),
168  INDEX l_sk      (l_suppkey ASC),169  INDEX l_sd      (l_shipdate ASC),
170  INDEX l_cd      (l_commitdate ASC),
171  INDEX l_rd      (l_receiptdate ASC),
Keywords should not be used as identifiers
164  l_comment       VARCHAR(44) NOT NULL,
165  PRIMARY KEY     (l_orderkey, l_linenumber),
166  INDEX l_ok      (l_orderkey ASC),
167  INDEX l_pk      (l_partkey ASC),168  INDEX l_sk      (l_suppkey ASC),
169  INDEX l_sd      (l_shipdate ASC),
170  INDEX l_cd      (l_commitdate ASC),
Keywords should not be used as identifiers
163  l_shipmode      CHAR(10) NOT NULL,
164  l_comment       VARCHAR(44) NOT NULL,
165  PRIMARY KEY     (l_orderkey, l_linenumber),
166  INDEX l_ok      (l_orderkey ASC),167  INDEX l_pk      (l_partkey ASC),
168  INDEX l_sk      (l_suppkey ASC),
169  INDEX l_sd      (l_shipdate ASC),
Keywords should not be used as identifiers
162  l_shipinstruct  CHAR(25) NOT NULL,
163  l_shipmode      CHAR(10) NOT NULL,
164  l_comment       VARCHAR(44) NOT NULL,
165  PRIMARY KEY     (l_orderkey, l_linenumber),166  INDEX l_ok      (l_orderkey ASC),
167  INDEX l_pk      (l_partkey ASC),
168  INDEX l_sk      (l_suppkey ASC),
Keywords should not be used as identifiers
143  'gs://sf-10/orders.tbl.8'
144) WITH delimiter='|';
145
146ALTER TABLE orders ADD CONSTRAINT orders_fkey_customer FOREIGN KEY (o_custkey) references customer (c_custkey);147
148CREATE TABLE lineitem (
149  l_orderkey      INTEGER NOT NULL,
Keywords should not be used as identifiers
129  o_shippriority       INTEGER NOT NULL,
130  o_comment            VARCHAR(79) NOT NULL,
131  INDEX o_ck           (o_custkey ASC),
132  INDEX o_od           (o_orderdate ASC)133);
134
135IMPORT INTO orders CSV DATA(
Keywords should not be used as identifiers
128  o_clerk              CHAR(15) NOT NULL,
129  o_shippriority       INTEGER NOT NULL,
130  o_comment            VARCHAR(79) NOT NULL,
131  INDEX o_ck           (o_custkey ASC),132  INDEX o_od           (o_orderdate ASC)
133);
134
Keywords should not be used as identifiers
116  'gs://sf-10/customer.tbl.8'
117) WITH delimiter='|';
118
119ALTER TABLE customer ADD CONSTRAINT customer_fkey_nation FOREIGN KEY (c_nationkey) references nation (n_nationkey);120
121CREATE TABLE orders (
122  o_orderkey           INTEGER NOT NULL PRIMARY KEY,
Keywords should not be used as identifiers
102  c_acctbal         FLOAT NOT NULL,
103  c_mktsegment      CHAR(10) NOT NULL,
104  c_comment         VARCHAR(117) NOT NULL,
105  INDEX c_nk        (c_nationkey ASC)106);
107
108IMPORT INTO customer CSV DATA(
Keywords should not be used as identifiers
 91) WITH delimiter='|';
 92
 93ALTER TABLE partsupp ADD CONSTRAINT partsupp_fkey_part FOREIGN KEY (ps_partkey) references part (p_partkey);
 94ALTER TABLE partsupp ADD CONSTRAINT partsupp_fkey_supplier FOREIGN KEY (ps_suppkey) references supplier (s_suppkey); 95
 96CREATE TABLE customer (
 97  c_custkey         INTEGER NOT NULL PRIMARY KEY,
Keywords should not be used as identifiers
 90  'gs://sf-10/partsupp.tbl.8'
 91) WITH delimiter='|';
 92
 93ALTER TABLE partsupp ADD CONSTRAINT partsupp_fkey_part FOREIGN KEY (ps_partkey) references part (p_partkey); 94ALTER TABLE partsupp ADD CONSTRAINT partsupp_fkey_supplier FOREIGN KEY (ps_suppkey) references supplier (s_suppkey);
 95
 96CREATE TABLE customer (
Keywords should not be used as identifiers
 76  ps_supplycost         FLOAT NOT NULL,
 77  ps_comment            VARCHAR(199) NOT NULL,
 78  PRIMARY KEY           (ps_partkey, ps_suppkey),
 79  INDEX ps_sk           (ps_suppkey ASC) 80);
 81
 82IMPORT INTO partsupp CSV DATA(
Keywords should not be used as identifiers
 75  ps_availqty           INTEGER NOT NULL,
 76  ps_supplycost         FLOAT NOT NULL,
 77  ps_comment            VARCHAR(199) NOT NULL,
 78  PRIMARY KEY           (ps_partkey, ps_suppkey), 79  INDEX ps_sk           (ps_suppkey ASC)
 80);
 81
Keywords should not be used as identifiers
 67  'gs://sf-10/supplier.tbl.8'
 68) WITH delimiter='|';
 69
 70ALTER TABLE supplier ADD CONSTRAINT supplier_fkey_nation FOREIGN KEY (s_nationkey) references nation (n_nationkey); 71
 72CREATE TABLE partsupp (
 73  ps_partkey            INTEGER NOT NULL,