Reputation: 1015
I am trying to import an SQL file as part of the database through PGAdmin3 but I am getting error as the schema not found. But when I try to select the namespace it list that schema.
Below is the output from the DB
test=# select nspname from pg_catalog.pg_namespace;
nspname
--------------------
pg_catalog
pg_toast
public
pg_temp_1
pg_toast_temp_1
information_schema
testschema
(7 rows)
Below is the sql commands which I am trying to run from script
CREATE TABLE TestSchema.Emp (
lastname VARCHAR(50) NOT NULL,
firstname VARCHAR(10) NOT NULL,
empid INTEGER PRIMARY KEY
};
ERROR: schema "testschema" does not exist
********** Error **********
ERROR: schema "testschema" does not exist
SQL state: 3F000
Any thoughts why this error is coming.
Upvotes: 0
Views: 1642
Reputation: 1261
You have a typo:
CREATE TABLE TestSchema.Emp (
lastname VARCHAR(50) NOT NULL,
firstname VARCHAR(10) NOT NULL,
empid INTEGER PRIMARY KEY
}; -- Put ) instead of }
Normally it does not work
Upvotes: 1
Reputation: 5621
Try to replace:
CREATE TABLE TestSchema.Emp (
By
CREATE TABLE testschema.Emp (
Upvotes: 0