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

Support for AWS Redshift #767

Open
andre-engelbrecht opened this issue Mar 29, 2021 · 7 comments · May be fixed by #766
Open

Support for AWS Redshift #767

andre-engelbrecht opened this issue Mar 29, 2021 · 7 comments · May be fixed by #766
Assignees
Labels
needs triage Impact of this request has to be valuated old-label enhancement Functionality that enhances existing features question Further information is requested

Comments

@andre-engelbrecht
Copy link

Does this package support AWS Redshift? Since Redshift is based on PostgreSQL, I'm hoping it'll just work?
I've been trying it out but getting connection timeout issues, not sure if this is due to bad config on AWS or lack of support for Redshift?

@Shinigami92
Copy link
Collaborator

AFAIK this project uses pg under the hood

"pg": ">=4.3.0 <9.0.0"

const client: Client = isExternalClient ? (connection as Client) : new Client(connection as string | ClientConfig)
const beforeCloseListeners: any[] = []
const createConnection: () => Promise<void> = () =>
new Promise((resolve, reject) => {
if (isExternalClient || connectionStatus === ConnectionStatus.CONNECTED) {
resolve()
} else if (connectionStatus === ConnectionStatus.ERROR) {
reject(new Error('Connection already failed, do not try to connect again'))
} else {
client.connect((err) => {

@andre-engelbrecht
Copy link
Author

Yes, I know, that's why I'm thinking it should be compatible. I suspect there's simply something off in my AWS config, and I'll be working on that today, but I just wanted to make sure from the "source" that it should be compatible.

@andre-engelbrecht
Copy link
Author

I got the AWS config sorted out and was able to reach the Redshift DB, but I encountered to following error, which I assume means that this package isn't compatible with Redshift afterall.

Error executing:
CREATE TABLE "public"."pgmigrations" ( id SERIAL PRIMARY KEY, name varchar(255) NOT NULL, run_on timestamp NOT NULL)
error: Column "pgmigrations.id" has unsupported type "serial".

Error executing:
select pg_advisory_unlock(7241865325823964) as "lockReleased"
error: function pg_advisory_unlock(bigint) does not exist

function pg_advisory_unlock(bigint) does not exist
Error: Unable to ensure migrations table: error: Column "pgmigrations.id" has unsupported type "serial".

Feel free to close this issue if there's nothing more to say here!?

@Shinigami92
Copy link
Collaborator

@goce-cz Could you have a look into that and triage it?
If there is nothing we can to support it, you should close the issue.
Otherwise let's discuss and think about it.

@littlewhywhat littlewhywhat self-assigned this May 24, 2021
@littlewhywhat littlewhywhat added the question Further information is requested label May 24, 2021
@littlewhywhat
Copy link
Contributor

hello, sorry for such a long time to answer.

yes we using serial for the table id in the migrations table... could we use smth else then unsupported types, for example, basic integer or smth. probably...

@andre-engelbrecht I believe, one way to overcome it, is to create the table for migrations manually prior and provide it's name to node-pg-migration (see https://salsita.github.io/node-pg-migrate/#/cli?id=configuration - migrationTable option) or use the default name pgmigrations.

node-pg-migrate will check if the table exists and have primary key constraint on id but that's about it.

@littlewhywhat
Copy link
Contributor

see also #766, maybe you gonna get new errors

@littlewhywhat littlewhywhat added old-label enhancement Functionality that enhances existing features needs triage Impact of this request has to be valuated labels May 31, 2021
@andre-engelbrecht
Copy link
Author

I ended up just manually handling migrations for now. I bit of manually effort, but our Redshift DB is pretty static.
Thanks for the feedback though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Impact of this request has to be valuated old-label enhancement Functionality that enhances existing features question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants