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

Error getting current schema #4

Open
crony1 opened this issue May 13, 2016 · 16 comments
Open

Error getting current schema #4

crony1 opened this issue May 13, 2016 · 16 comments

Comments

@crony1
Copy link

crony1 commented May 13, 2016

The plugin is issuing 'select current_user' to Redshift and erroring with the following:

Unexpected error running Liquibase: Error executing SQL select current_schema: [Amazon](500310) Invalid operation: column "current_schema" does not exist;
Issuing the command directly to Redshift returns the same error. I believe the correct statement should be 'select current_schema()' according to Amazon documentation

EDIT: I should add that I was using the JDBC driver provided by Amazon.

┆Issue is synchronized with this Jira Bug by Unito

@haavardeide
Copy link

@crony1 Did you resolve this?

@ValentinOzanne
Copy link

Hi,
I am facing the same issue with liquibase 3.5.1.
With liquibase 3.3.2 I can see the following :
Error setting up or running Liquibase: java.sql.SQLException: [Amazon](500310) Invalid operation: syntax error at or near "TAG";

@crony1
Copy link
Author

crony1 commented Jul 9, 2016

@haavardeide I never did resolve this unfortunately.

@trevorsmith
Copy link

I just ran across this by chance while searching for a related Redshift error.

The current_schema error can be resolved by changing select current_schema to select current_schema(). Redshift thinks it is a column name otherwise.

@2un
Copy link

2un commented Jul 19, 2016

we faced the same issue: "Amazon Invalid operation: column "current_schema" does not exist;"
Any updates?

@ValentinOzanne
Copy link

ValentinOzanne commented Jul 19, 2016

Hi
You can have a look at my fork :
https://github.com/ValentinOzanne/liquibase-redshift

I committed a workaround to use "public" schema instead of launching an unsupported query. I quickly tried to use "select current_schema()" request but it didn't work and I didn't work again on this issue.

Hope it helps

@haavardeide
Copy link

@ValentinOzanne That fork did the trick for me! Thanks!

@jimsunrun
Copy link

Please merge your fix back into the main project so we can eventually get this version from the maven-repo.

@Engineer1111
Copy link

Btw, the Error setting up or running Liquibase: java.sql.SQLException: Amazon Invalid operation: syntax error at or near "TAG";

is caused during the creation of databasechangelog. This is because you use a mysql script for redshift. Tag is not a reserved word in mysql, but it is a reserved word in Redshift

@fixl
Copy link

fixl commented Jul 11, 2018

Did anyone work around the TAG issue @Engineer1111 highlighted? Does that mean liquibase isn't usable for Redshift at the moment?

@TamilVP
Copy link

TamilVP commented Aug 2, 2018

I am trying to use Liquibase for redshift migration and ran into the same issue @Engineer1111 highlighted. Please help on the workaround. Can I go ahead and use it for redshift?

@radoslawjakubowski
Copy link

Using 1.0-SNAPSHOT it is working

nvoxland added a commit that referenced this issue Mar 22, 2019
Issue #4: Error getting current schema
@romankoval
Copy link

@nvoxland, Could you please deploy/publish artifacts version 1.1, containing latest changes?

Thanks a lot!

@romankoval
Copy link

I've built latest 1.1-SNAPSHOT and put into local repo, but the issue with TAG isn't fixed yet.

As well weird things may happened after few restarts all tables are recreated. WHY?

@balbusm
Copy link
Contributor

balbusm commented Mar 10, 2020

Created PR for TAG issue.
As a workaround you can create your own RedshiftDatabase class:

package liquibase.ext.redshiftfix.database; // Class has to be located in this package

import liquibase.ext.redshift.database.RedshiftDatabase;

public class RedshiftDatabaseFix extends RedshiftDatabase {

    private static final int HIGH_PRIORITY = 5;

    @Override
    public int getPriority() {
        return HIGH_PRIORITY;
    }

    @Override
    public String getShortName() {
        return "redshiftFix";
    }

    @Override
    protected String getDefaultDatabaseProductName() {
        return "RedshiftFix";
    }
}

@thegeekyasian
Copy link

Can we have this resolved please?

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

No branches or pull requests