Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
b291af88
Commit
b291af88
authored
6 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-41
: sql between is inclusive, but we want exclusive edges
parent
6293ff36
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql
+2
-11
2 additions, 11 deletions
...ssignmentDatabase/radb/sql/add_functions_and_triggers.sql
with
2 additions
and
11 deletions
SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql
+
2
−
11
View file @
b291af88
...
@@ -297,7 +297,8 @@ BEGIN
...
@@ -297,7 +297,8 @@ BEGIN
FOR
intermediate_usage
IN
SELECT
*
FROM
resource_allocation
.
resource_usage
ru
FOR
intermediate_usage
IN
SELECT
*
FROM
resource_allocation
.
resource_usage
ru
WHERE
ru
.
resource_id
=
new_claim
.
resource_id
WHERE
ru
.
resource_id
=
new_claim
.
resource_id
AND
ru
.
status_id
=
new_claim
.
status_id
AND
ru
.
status_id
=
new_claim
.
status_id
AND
ru
.
as_of_timestamp
between
new_claim
.
starttime
and
new_claim
.
endtime
AND
ru
.
as_of_timestamp
>
new_claim
.
starttime
AND
ru
.
as_of_timestamp
<
new_claim
.
endtime
LOOP
LOOP
UPDATE
resource_allocation
.
resource_usage
ru
SET
usage
=
intermediate_usage
.
usage
+
new_claim
.
claim_size
UPDATE
resource_allocation
.
resource_usage
ru
SET
usage
=
intermediate_usage
.
usage
+
new_claim
.
claim_size
WHERE
ru
.
id
=
intermediate_usage
.
id
;
WHERE
ru
.
id
=
intermediate_usage
.
id
;
...
@@ -921,16 +922,6 @@ DECLARE
...
@@ -921,16 +922,6 @@ DECLARE
BEGIN
BEGIN
SELECT
*
from
clock_timestamp
()
into
proc_start
;
SELECT
*
from
clock_timestamp
()
into
proc_start
;
-- IF TG_OP = 'INSERT' THEN
-- RAISE NOTICE 'before_claim_insertupdatedelete % %', TG_OP, NEW;
-- END IF;
-- IF TG_OP = 'UPDATE' THEN
-- RAISE NOTICE 'before_claim_insertupdatedelete % % %', TG_OP, OLD, NEW;
-- END IF;
-- IF TG_OP = 'DELETE' THEN
-- RAISE NOTICE 'before_claim_insertupdatedelete % %', TG_OP, OLD;
-- END IF;
--order of following steps is important, do not reorder the steps
--order of following steps is important, do not reorder the steps
IF
TG_OP
=
'INSERT'
OR
TG_OP
=
'UPDATE'
THEN
IF
TG_OP
=
'INSERT'
OR
TG_OP
=
'UPDATE'
THEN
IF
NEW
.
starttime
>=
NEW
.
endtime
THEN
IF
NEW
.
starttime
>=
NEW
.
endtime
THEN
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment