question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[PostgreSQL] Rename sequence is missing schema qualification

See original GitHub issue

System information:

  • OS: Ubuntu 18.04 64bit
  • Java: OpenJDK 11.0.4
  • DBeaver: 6.3.0.201912011827
  • Additional extensions: No

Connection specification:

  • DB: PostgreSQL 9.4.7
  • Driver: PostgreSQL JDBC Driver
  • Do you use tunnels or proxies (SSH, SOCKS, etc)? No

Describe the problem you’re observing:

When renaming a sequence either through the context menu or through the properties pane, the generated DDL is missing the schema.

This is different from the fixed “Unable to rename sequence in Postgresql” #5902 because it was using the new name for the source name.

Steps to reproduce, if exist:

Create a schema and sequence:

CREATE SCHEMA test_schema;

CREATE SEQUENCE test_schema.test_seq;

Open the sequence’s properties pane, change its name to “test_seqqq”, click “Save”, and the Persist Changes dialog box will have the following DDL:

ALTER SEQUENCE test_seq RENAME TO test_seqqq;

This SQL statement is missing the schema qualification. It should be:

ALTER SEQUENCE test_schema.test_seq RENAME TO test_seqqq;

Include any warning/errors/backtraces from the logs

When trying to persist the incorrect DDL the following error details is displayed:

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
helmd8dcommented, Dec 19, 2019

I observed the same behaviour for the RENAME VIEW statement. Returned error is “Object … does not exist”. When adding schema name manually in generated SQL it is possible to execute the statement successfully. Dbeaver 2.6.5 community/Windows. Jdbc/Exasol DB.

0reactions
uslsscommented, Jan 7, 2020

verified

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: 15: ALTER SEQUENCE - PostgreSQL
ALTER SEQUENCE conforms to the SQL standard, except for the AS , START WITH , OWNED BY , OWNER TO , RENAME TO...
Read more >
Documentation: 15: CREATE SEQUENCE - PostgreSQL
CREATE SEQUENCE creates a new sequence number generator. ... The name (optionally schema-qualified) of the sequence to be created. data_type.
Read more >
Documentation: 9.6: ALTER TABLE - PostgreSQL
The name (optionally schema-qualified) of an existing table to alter. If ONLY is specified before the table name, only that table is altered....
Read more >
Documentation: 15: ALTER EXTENSION - PostgreSQL
The data type(s) of the operator's arguments (optionally schema-qualified). Write NONE for the missing argument of a prefix operator. PROCEDURAL. This is a ......
Read more >
Sequence does not exist when it does - Postgres/Spring Boot
It mean your sequence either not exist in database OR the user doesn't has permission to access it. Solution: Check user_id_seq in database...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found