Redshift - Relation does not exist on materialized view with AutoRefresh On - amazon-redshift

one of our users is getting an error (only occasionally) on a view that has autorefresh on. the name of the table is vwdeviceplatform. Is it because the view is being autofreshed at the time they are running the query? Any way to avoid that? We don't want to schedule manual refreshes.
Invalid operation. Relation "mv_tbl_vwdeviceplatform_0" does not exist.
User is using dbeaver

Related

Access table showing incorrect data from a linked table

I have an issue with my access table which is linked from postgres. The table in postgres has a time column with a 'time without time zone' data type and it looks fine. However when i linked the table to Access, the same fields show the same data but have a date in front of them. It looks like this, '07/01/2023 11:33:00 AM'. I just want it to display time.
I have tried chaning the data type in postgres and relinking the table but that didnt help. I've deleted the table and created a new one and that didnt help. Whenever I try to delete the dates directly from the table in access I get an error 'Another user edited this record and saved the changes before you attempted to save your changes' and it goes back to how it was.

How can I edit table properties in tabular model in visual studio?

I want to add new columns in two tables in a tabular model. But I faced three questions in the process.
When I opened the table properties, I found here has filter rows commands. I tried to directly delete filter rows command here, but I clicked validate, it shows the credentials for this operation could not be validated. How can I renew the SQL statement?
When I open design and click import. Error appears: Cannot import the partition query because the set of columns in the partition definition does not match those in the table definition. The following required columns are mission.
The partition only sets the datetime, I do not understand what the error is here.
When I opened design in the table properties and click update, the error: cannot save changes because the partitions' schema has been changed. Please correct the schema and try again. But the table does not have any partitions. How can I fix it?

Postgresql: create view and use of default tablespace?

When I try to create a view in PostgreSQL 13 I get an error saying: "permission denied for tablespace tbs_dft". As you can see I've changed the system default tablespace. The problem is easy to fix by granting create on tablespace 'tbs_dft'. But my question is: why does it need to access the 'default tablespace' when creating a view containing a simple select statement? Although this is not a practical issue I am trying to learn Postgresql having come from Oracle and hence I'm not sure what it is I don't understand about the way View creation works in Postgresql.
Any information gratefully received.
The reason is that this check is done whenever a relation is created (in DefineRelation in src/backend/commands/tablecmds.c). A relation is anything stored in pg_class: a table, an index, a sequence, a composite type, a view or a materialized view.
Now views or composite types do not have data files, so the check could be skipped in this case. If that is important for you, get in touch with development on the pgsql-hackers mailing list. This could be improved in my opinion.
Here is the code in question:
/* Check permissions except when using database's default */
if (OidIsValid(tablespaceId) && tablespaceId != MyDatabaseTableSpace)
{
AclResult aclresult;
aclresult = pg_tablespace_aclcheck(tablespaceId, GetUserId(),
ACL_CREATE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_TABLESPACE,
get_tablespace_name(tablespaceId));
}

Making a view of all tasks - unexpected 'SHOW'

I would like to create a view that shows a full list of active and inactive tasks. Is there a way to do that?
Context: I'm making some automatic reporting that alerts us on failed tasks or inactive tasks.
CREATE OR REPLACE VIEW "DB"."PUBLIC"."SNOWFLAKE_TASK_LIST" COPY GRANTS AS
SHOW tasks IN "DEV"."PUBLIC";
Gives me the error: unexpected 'SHOW'
I have no tasks, but give I suspect this a SHOW thing verse a task thing, I will substitute USERS:
use role accountadmin;
show users;
CREATE OR REPLACE VIEW "DB"."PUBLIC"."SNOWFLAKE_USERS_LIST" AS
SHOW users;
it would seem that SHOWs are not SELECTs. which makes sense, when given they are different, they give results that appear like table base results, but a number of setup functions are not true tables in the sense they are in Postgres.
This can further be seen in the fact
select * from (
show users
);
gives the error
SQL compilation error: Object 'SHOW' does not exist or not authorized.
and yet
SHOW users;
select * from table(result_scan(-1));
works.
But maybe the TASK_HISTORY table info table has your needed details, OR maybe the show command does work inside a stored procedure, thus you can asses the result_scan(-1) to capture the details.

SqlDataAdapter Update

Can any one help me why this error occurs when i update using sqlDataadapter with join query
Dynamic SQL generation is not supported against multiple base tables.
You have a "join" in your main query for your dataset (The first one in the TableAdapter with a check by it). You can't automatically generate insert/update/delete logic for a TableAdapter when the main query has multiple tables referenced in the query via a join. The designer isn't smart enough to figure out which table you want to send updates to in that case, that is why you get the error message.
Solution. Ensure that your main query only references the table you want the designer to write insert/update/delete code for. Your secondary queries may reference as many tables as you want.
It was in the case that i was trying to set value for identity column in my datarow. Simply i deleted the code to set value for identity column and it will work.
My Scenario:
Database:
uin [primary, identity]
name
address
Whenever i tried to set the datarow("uin") the error occurs. But works fine with datarow("name") and datarow("address").
Hope it works for you too