Skip to content

Case sensitive object name – Issue & Resolution

ISSUE:
Getting error message like below, even when you can see the objects exists:
ERROR: Relation ‘TESTING’ does not exist
ERROR: Attribute ‘name’ not found

DESCRIPTION:
In Netezza we can create case-sensitive object names by enclosing the in double quotes (“”) while creating the objects. If object is not enclosed in double quotes then Netezza by default will consider it uppercase. Same is the scenario when we query these objects.

RESOLUTION:
Avoid creating case sensitive objects except if it is needed. To query these objects use double quotes around the object name . Make sure it is spelled in correct case for case sensitive objects.

EXAMPLE:
Here is a example of how case sensitive and non case sensitive object names work in Netezza.

TESTDB(ADMIN)=> create table “Testing” (name char(10), “Name” char(10));
CREATE TABLE

TESTDB(ADMIN)=> select * from Testing;
ERROR: Relation ‘TESTING’ does not exist

TESTDB(ADMIN)=> select * from “Testing”;
NAME | Name
——+——
(0 rows)

TESTDB(ADMIN)=> select name from “Testing”;
NAME
——
(0 rows)

TESTDB(ADMIN)=> select name,”Name” from “Testing”;
NAME | Name
——+——
(0 rows)

TESTDB(ADMIN)=> select “name”,”Name” from “Testing”;
ERROR: Attribute ‘name’ not found

TESTDB(ADMIN)=> select “NAME”,”Name” from “Testing”;
NAME | Name
——+——
(0 rows)

TESTDB(ADMIN)=> drop table Testing;
ERROR: Relation ‘TESTING’ does not exist

TESTDB(ADMIN)=> drop table “Testing”;
DROP TABLE