File: duckdb_constraints_issue12863.test

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (32 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# name: test/sql/table_function/duckdb_constraints_issue12863.test
# description: Issue #12863 - INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS doesn't list foreign keys when declaration case doesn't match reference case
# group: [table_function]

statement ok
pragma enable_verification

statement ok
CREATE TABLE a (ID int PRIMARY KEY);

statement ok
CREATE TABLE b (id int REFERENCES A);

query II
SELECT constraint_name, unique_constraint_name FROM information_schema.referential_constraints;
----
b_id_id_fkey	a_id_pkey

# test multiple schemas with the same table names/references
statement ok
CREATE SCHEMA s1;

statement ok
CREATE TABLE s1.a (ID int PRIMARY KEY);

statement ok
CREATE TABLE s1.b (id int REFERENCES s1.A);

query I
SELECT COUNT(*) FROM information_schema.referential_constraints;
----
2