Open roji opened 8 years ago
From @kenjiuno on June 25, 2015 12:29
Hi @snehitvelma Thanks for reporting it! I'll check about this problem.
> Npgsql.NpgsqlException: ERROR: 42883: function information_schema._pg_expandarray(smallint[]) does not exist
What version of PostgreSQL server do you connect to?
From @snehitvelma on June 25, 2015 13:24
I'm connecting to Amazon Red Shift.
From @kenjiuno on June 26, 2015 4:35
Ok, I'll check the way how to fix this issue. This may take some while...
From @kenjiuno on December 4, 2015 0:18
Note to self:
conkey
and confkey
in pg_constraint are int2[]
.
They need to be expanded from array to rows by using information_schema._pg_expandarray
, unnest
or such.
However redshift doesn't implement it.
An idea is to fully rewrite all SQL queries in ssdl using only information_schema.
From @kenjiuno on December 10, 2015 11:56
I have tried using information_schema
but it doesn't help... My new NpgsqlSchema.ssdl
It will need another tool in order to scaffold Entity Data Model from Redshift db.
Official schema views are: PG_TABLE_DEF and SVV_TABLE_INFO. Redshift db doesn't rely on pk/fk constraints. Define Primary Key and Foreign Key Constraints
So mark [Key]
to the possible primary key column property. Just trick the EF!
Some important schemata cannot be queried: select * from information_schema.key_column_usage
An error occurred when executing the SQL command:
select * from information_schema.key_column_usage
[Amazon](500310) Invalid operation: must be superuser to examine "max_index_keys";
Execution time: 0.12s
1 statement failed.
So, EF's scaffolding cannot be done against Redshift...
Unable to Access information_schema.constraint_column_usage - SuperUser? https://forums.aws.amazon.com/thread.jspa?threadID=133514
We can define primary keys and foreign keys on Redshift db.
However there is no good way to query them via information_schema
.
From @snehitvelma on June 25, 2015 6:32
Unable to generate the model because of the following exception: '
Copied from original issue: npgsql/npgsql#651