liquibase / liquibase-redshift

Liquibase support for Redshift
17 stars 18 forks source link

Error getting current schema #4

Open crony1 opened 8 years ago

crony1 commented 8 years ago

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 commented 8 years ago

@crony1 Did you resolve this?

ValentinOzanne commented 8 years ago

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 commented 8 years ago

@haavardeide I never did resolve this unfortunately.

trevorsmith commented 8 years ago

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 commented 8 years ago

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

ValentinOzanne commented 8 years ago

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 commented 8 years ago

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

jimsunrun commented 8 years ago

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

Engineer1111 commented 6 years ago

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 commented 6 years ago

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

TamilVP commented 6 years ago

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 commented 5 years ago

Using 1.0-SNAPSHOT it is working

romankoval commented 5 years ago

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

Thanks a lot!

romankoval commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

Can we have this resolved please?