New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YSQL] pg_dump of sequences has incorrect ordering #1793
Comments
It should be noted that the issue is on the server (YB implementation of Postgres) side, not the client (pg_dump) side. When the pg_dump built in the YugaByte repository connects to a vanilla Postgres cluster, the correct output as shown in @ndeodhar's second code snippet is generated. Having it connect to a YugaByte cluster, on the other hand, results in the incorrect output. |
The cause of this issue is a bug (currently being investigated) in how YSQL does system columns. pg_dump does this query of default attributes:
On a vanilla Postgres cluster it returns something like this:
But on an equivalent YugaByte cluster it returns this:
The underlying problem on YugaByte is that the
|
@georgeklees Looks like index lookup does not work as expected here:
|
The root cause of the incorrect output that
Add this line:
This causes the output to match up with vanilla Postgres. However, we still need |
Summary: * Add support for the tableoid column in system catalog tables (this overlaps with Shane's RBAC diff, having identical code to it) so that default column values for SERIAL tables are outputted in the right place * Output `PRIMARY KEY` constraints within `CREATE TABLE` instead of as a separate `ALTER TABLE` command; this led to fixing [issue #1935](#1935) also Originally [issue #1792](#1792) was addressed by having `psql` save and restore the search path during a `\i` command, but it was realized that this might actually break `psql`'s intended behavior, so this issue needs further discussion. Test Plan: Try the scenarios in #1793 and #1791 Also run the newly-added Java test `TestPgDump` Reviewers: mihnea, neha Reviewed By: mihnea, neha Subscribers: srhickma, yql Differential Revision: https://phabricator.dev.yugabyte.com/D6956
When we pg_dump a database containing sequences, pg_dump output has incorrect ordering in which
CREATE TABLE
uses the sequence before it is created usingCREATE SEQUENCE
.Example pg_dump output:
pg_dump on vanilla postgres works as expected though. Here's a sample output:
The text was updated successfully, but these errors were encountered: