Unqualified reference 'ordinal_position' found in select with more than one referenced table/view
45ORDER BY non_unique,
46 TYPE,
47 index_name,
48 ordinal_position
Unqualified reference 'index_name' found in select with more than one referenced table/view
44 AND ct.relname = 'j'
45ORDER BY non_unique,
46 TYPE,
47 index_name,48 ordinal_position
Unqualified reference 'TYPE' found in select with more than one referenced table/view
43 AND n.nspname = 'public'
44 AND ct.relname = 'j'
45ORDER BY non_unique,
46 TYPE,47 index_name,
48 ordinal_position
Unqualified reference 'non_unique' found in select with more than one referenced table/view
42WHERE TRUE
43 AND n.nspname = 'public'
44 AND ct.relname = 'j'
45ORDER BY non_unique,46 TYPE,
47 index_name,
48 ordinal_position
Description
References should be qualified if SELECT
has more than one referenced table/view.
NB: Except if they’re present in a USING
clause.
Bad practice
In this example, the reference ‘vee’ has not been declared and the variables ‘a’ and ‘b’ are potentially ambiguous.
SELECT a, b
FROM foo
LEFT JOIN vee ON vee.a = foo.a
Recommended
Add the references.
SELECT foo.a, vee.b
FROM foo
LEFT JOIN vee ON vee.a = foo.a