Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F2912180
mark-as-missing.sql
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
zack
Nov 3 2017, 2:35 PM
2017-11-03 14:35:50 (UTC+1)
Size
872 B
Subscribers
None
mark-as-missing.sql
View Options
BEGIN
;
CREATE
TEMPORARY
TABLE
tmp_oversize_contents
(
sha1
sha1
PRIMARY
KEY
);
COPY
tmp_oversize_contents
FROM
PROGRAM
'xzcat /tmp/oversize-contents.txt.xz | sed ''s/^/\\\\x/'''
;
INSERT
INTO
skipped_content
(
sha1
,
sha1_git
,
sha256
,
blake2s256
,
length
,
ctime
,
object_id
,
status
,
reason
)
SELECT
sha1
,
sha1_git
,
sha256
,
blake2s256
,
length
,
ctime
,
object_id
,
'absent'
,
'Content too large'
FROM
content
WHERE
sha1
IN
(
SELECT
sha1
FROM
tmp_oversize_contents
)
ON
CONFLICT
(
sha1_git
)
DO
UPDATE
SET
sha1
=
EXCLUDED
.
sha1
,
sha1_git
=
EXCLUDED
.
sha1_git
,
sha256
=
EXCLUDED
.
sha256
,
blake2s256
=
EXCLUDED
.
blake2s256
,
length
=
EXCLUDED
.
length
,
ctime
=
LEAST
(
skipped_content
.
ctime
,
EXCLUDED
.
ctime
),
object_id
=
EXCLUDED
.
object_id
;
DELETE
FROM
content
WHERE
sha1
IN
(
SELECT
sha1
FROM
tmp_oversize_contents
);
COMMIT
;
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
204803
Attached To
T809: move contents larger than current injection limit to separate object storage
Event Timeline
zack
changed the visibility from "
zack (Stefano Zacchiroli)
" to "Public (No Login Required)".
Nov 3 2017, 2:37 PM
2017-11-03 14:37:39 (UTC+1)
Log In to Comment