Skip to content
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

Fix "reset sequences" crash on tables with case sensitive column names #1509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codereverser
Copy link

@codereverser codereverser commented Jul 16, 2023

On case sensitive migrations (i.e. with "quote identifiers"), reset sequences fail with the following error.

Database error 42703: column ""<columnName>"" of relation "<table>" does not exist

This is due to invalid parameters being passed to pg_get_serial_sequence function introduced in e32066d

for example, on a mysql table with following definition

CREATE TABLE botLog(
    `logID` bigint(20) NOT NULL AUTO_INCREMENT, 
    `message` varchar(255), 
    PRIMARY KEY (`logID`)
);
SELECT pg_get_serial_sequence(quote_ident('public') || '.' || quote_ident('botLog'), quote_ident('logID'));
ERROR:  column ""logID"" of relation "botLog" does not exist

throws the same error, but the following works

SELECT pg_get_serial_sequence(quote_ident('public') || '.' || quote_ident('botLog'), 'logID');
  pg_get_serial_sequence
---------------------------
 public."botLog_logID_seq"

ref: #425

@Asher-JH
Copy link

Asher-JH commented Oct 3, 2024

Is this something that can be merged in soon? facing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants