DataJointError: Found a part table without its master table - datajoint

I am using datajoint python '0.12.8'.
When trying to delete from an upstream table, I get the following error message:
DataJointError: Found a part table "someschema"."table_part-table" without its master table. I can preview table as well as its part table without issues.
The delete goes through when calling it directly on the table. However, even when the entries are gone from that table, calling .delete() on any upstream table still results in the error above.
I am initialising someschema in that session via:
someschema = dj.schema('the_correct_database')
someschema.spawn_missing_classes()

Updating to datajoint-0.13.1 fixed this issue for me.

Related

DBeaver - Column "columns name' is read-only: No corresponding table column

I am using DBeaver on Mac and suddenly can't edit/udpate anything on results cell, I get this message: Column "columns name' is read-only: No corresponding table column. However, when I use UPDATE command it works just fine.
The challenge is that I have multiple updates to make and it is very convenient to do it ib the results cells.
Other users still can do it and I am suspecting this is something related to my DBeaver client
Any thoughts? Thank you!
Same issue here, solved after ommiting rowid as column in then select clause. It appears to be a conflict betwween named an * as column selector in 22.3.3 version. Try to use only * or name explicitly selected columns.
I have faced the same issue, when added a column from script and tried to update data on table from UI. it can solved by disconnecting and connecting to database as DBeaver currently don't refresh the DDLs.

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.

User is getting "You tried to lock table '' while opening it, but the table cannot be locked because it is currently in use."

Getting this error, with no table listed, when the user logs in to the order system.
The query is, roughly
SELECT FormParts.*, qrySomeOtherColumns.*, CBool(0) AS ObjMissing INTO Temp_SessionFormParts
FROM FormParts INNER JOIN qrySomeOtherColumns ON FormParts.ID = qrySomeOtherColumns.FormPartID
WHERE EmpId = EmpID();
The data is coming from linked tables with a Postgres back end.
The data is going into the local table "Temp_SessionFormParts"
This is a local table in the front end, so no one else should have access to it.
Everyone else has a copy of the same database, but no one else gets the error.
Where it gets weird is that she only gets the error when she starts the app with our standard shortcut that copies the latest version.
copy "\\NASdiskstation\Install\Deploy\pgFrontEnd.accde" "C:\Merge Documents\"
start "" MSAccess.exe "C:\Merge Documents\pgFrontEnd.accde"
But if she starts Access from the Start Menu, and then opens the same database from the selections, it works fine.
Seems to me that those two routes should give the same result since she's already copied the latest to C:.
I went ahead an posted this question, since I had it written up, because I've seen this error a few times. So this may be helpful.
Normally, you can't SELECT INTO an existing table. But Access detects that situation and helpfully deletes the table before executing the insert.
Somehow this was failing.
DROP TABLE Temp_SessionFormParts
before the INSERT fixed the issue.
No idea why it sometimes didn't work for some people or why running Access directly changed that.

Postgis + Qgis - filtered row access - problem on insert and update new points

I have this problem:
PostGis Server with a table: Table_Points_of_all_works
table has a field "ID_WORK" so I can filter points for only one work.
with different groups (a group for each work).
Each group can access to the only work related, and view, insert, delete rows (related to their only ID_Work)
To do this I created groups and policies:
CREATE POLICY policy_for_this_groupofWork
ON public."Table_Points_of_all_works"
AS PERMISSIVE
FOR ALL
TO "GroupWork12"
USING ("ID_WORK"=12)
WITH CHECK ("ID_WORK"=12);
Viewing the table of points in QGIS works: only points of related work are seen.
But when I insert new points and giving in the field ID_WORK correct work (12 in this case), I receive an error while updating SQL:
"Could not commit changes to layer Table_Points_of_all_works
Errors: ERROR: 1 feature(s) not added - provider doesn't support adding features."
If I do the same thing with admin users (postgres) all works fine.
Anyone can help me?
thanks in advance,
Filippo

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