docs: add comment explaining select version() (#11376)

This commit is contained in:
Mike Guida 2025-04-01 16:41:44 -06:00 committed by GitHub
parent 7b242e1698
commit 592251962d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4157,6 +4157,12 @@ export class PostgresQueryRunner
* Loads Postgres version.
*/
async getVersion(): Promise<string> {
// we use `SELECT version()` instead of `SHOW server_version` or `SHOW server_version_num`
// to maintain compatability with Amazon Redshift.
//
// see:
// - https://github.com/typeorm/typeorm/pull/9319
// - https://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-functions.html
const result: [{ version: string }] = await this.query(
`SELECT version()`,
)