|Related to : Adding FK constraint WITH CHECK (SQL Server)|
|SQL constraint to check another table column|
Finally found an answer by myself. It will sound silly, but I do hope
it helps anyone else out there struggling with this case.
UNIQUE (attr1, attr2)
inside table1 we are creating a unique key, but since the primary is
just attr1, there is no way that there would be duplicates of the same
tuple with different attr2s.
Point being, now the combination of these two is a unique key,
|SQL constraint check with date from table linked with foreign key|
This is not possible to do using check constraints, since check
constraints can only refer to columns inside the same table.
Furthermore, foreign key constraints only support equi-joins.
If you must perform this check at the database level instead of your
application level, you could do it using a trigger on INSERT/UPDATE on
the action-table. Each time a record is inserted or updated, you check
|What is the overall Big O run time of Kruskal’s algorithm if BFS was used to check whether adding an edge creates a cycle?|
It would be O(V * E + E * log E). Each BFS takes O(V) time because
there are V - 1 edges in a tree(or less if the tree is not completely
build yet) and it is run for each edge(V is the number of vertices, E
is the number of edges). So it is O(V * E) in total. E * log E term
comes from sorting the edges.
|Adding a filter to a Glassfish server|
Filters are independently added w.r.t. servlets
|How do I check if the rsyncd (server) is alive?|
I guess you could do some dry-run like:
rsync -n 192.168.1.200::
share Public Share
and check the result. That "share" you see in the response was created
just for test purpose in my rsyncd.conf on rsync test server. Testing
port open may respond success while the process is stalled.