0

I am running a DDL statement like this in Postgres 11

ALTER SEQUENCE kwt.VisitReport_seq OWNED BY kwt.VisitReport;

I am running it as DBADMIN.

Yet I get some weird error:

SQL Error [42P01]: ERROR: relation "kwt" does not exist ERROR: relation "kwt" does not exist ERROR: relation "kwt" does not exist

But this is strange... kwt is not a relation, it is a schema.

What is going on?!

peter.petrov
  • 38,363
  • 16
  • 94
  • 159

1 Answers1

1

As often happens right after posting here I found the problem.

The statement should be:

ALTER SEQUENCE kwt.VisitReport_seq OWNED BY kwt.VisitReport.ID;

i.e. it should refer (of course) to the column name, not to the table name.

peter.petrov
  • 38,363
  • 16
  • 94
  • 159