Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nckbG-0008GJ-Ko for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 09:08:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nckbF-0002kC-Hq for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 09:08:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncidA-00060y-Cq for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 07:02:04 +0000 Received: from mr85p00im-ztdg06021701.me.com ([17.58.23.196]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncid8-0003Ua-MJ for pgsql-general@postgresql.org; Fri, 08 Apr 2022 07:02:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1649401320; bh=+l1qK3Hco0rugbduUnstHWRG0/SphY1NWiXELumP1co=; h=Content-Type:from:Mime-Version:Subject:Message-Id:Date:to; b=GA/laeb85vR2CvlTLxsy4lbyRvLCTqXgFytSo6nt50NpxX2wjvhT438vqd0R2bBMZ z6CSn+FlnVQlFddt0HHSsuCxQB7MSbv9cVPHApr2TJYssOeWA9lempexR7rr3x5FQi CVYdi3Oiy+XQqBoeDVxqTwU4X+XpEcflTY+8DtwGMut5pyhIhY82veEl9LiHNFxoIq EgrXSOgVFUSh/5b/fCUM3ma/LTGMeGf8OVa3xyF+syHf582ko9ch/3AykaXs1ePi8q dFfLExJFFvuQMnk+RQwLV/mRgrlkKosnTNRqKwF5n64ycql9K4Was74Q39hXL0Pw+9 DfsWh7D3fxSHw== Received: from smtpclient.apple (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-ztdg06021701.me.com (Postfix) with ESMTPSA id D697B9A09CE for ; Fri, 8 Apr 2022 07:01:59 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-A9CA6106-94E7-47E7-82FD-CA3248A584C8 Content-Transfer-Encoding: 7bit from: friend.have_00@icloud.com Mime-Version: 1.0 (1.0) Subject: Could not read block 0 in file Message-Id: <5D839689-C2C9-437E-AD6B-CD744AC3F489@icloud.com> Date: Fri, 8 Apr 2022 17:01:57 +1000 to: pgsql-general@postgresql.org X-Mailer: iPad Mail (19E258) X-MANTSH: 1TEIXR1gbG1oaGkNHB1BeTkMbGxoZHhkaGxEKTEMXGxoEGxsYBBIcBB8fEBseGh8 aEQpMWRcYHhMRCllEF2ISBWdwTntmaH1PEQpZTRdkRURPEQpZSRcacRoQGncGGBgTcRsTGRAad wYYGgYaEQpZXhdoY3kRCkNOF2MZS0l+Hx1pWn1CHkVmeW9QGWt/dWFdf1oda0JdRWZuEQpYXBc ZBBoEHhwHSx8bGRtMHRsFGx0EGxsbBBsfHwQbHx0QGx4aHxoRCl5ZF3BCc2FuEQpMWhdpaENrT WsRCkNaFxsYGwQYGhoEGBwEGB0RCkJeFxsRCkReFxgRCl5OFxsRCkJFF2gaBVgBR2dHH1kFEQp CThdrRRpSUB5DXFlcaBEKQkwXZ0tOSF9ifQFoZh4RCkJsF2JMYhlbbGtMHmxZEQpCQBdrbHtCT 11daWRhfxEKQlgXZnMceBxTaW1CWE8RCk1eFxsRCkVDFxsRCnBoF298En5TGUJteEhMEBoRCnB oF21mWG5nemZPW0gcEBoRCnBoF2keGX5BfWJLHGtgEBoRCnBoF2VifxJEbx54Y15MEBoRCnBoF 2lhaFhwSXpvegFDEBoRCnBsF2RpaxxOXUJEWWRmEB4SEQpwTBdteUx4ZltnGlhPYBAaEQptfhc bEQpYTRdLEQ== X-CLX-Shades: None X-CLX-UShades: None X-CLX-Score: 249 X-CLX-UnSpecialScore: None X-CLX-Spam: false X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.572,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2020-02-14=5F11:2020-02-14=5F02,2020-02-14=5F11,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 clxscore=249 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2204080038 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail-A9CA6106-94E7-47E7-82FD-CA3248A584C8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =EF=BB=BFHi, While we are looking for a suitable backup to recover from, I hope this comm= unity may have some other advice on forward steps in case we cannot restore.= RCA: Unexpected shutdown due to critical power failure Current Issue: The file base/16509/17869 is zero bytes in size. Additional Information: Platform: Windows Server PostGres Version: 10.16 (64-bit) The database does start, and is otherwise functioning and working aside from= a particular application feature that relies on the lookup of the values in= the table that was held in the currently zero-bytes data file. The non-functioning table (ApprovalStageDefinition) is a relatively simple t= able with 5 rows of static data. The contents can easily be recovered with a= query such as the following for each of the 5 records: insert into ApprovalStageDefinition values (1, 'Stage One', 'Stage One'); The error message when running this query is: ERROR: could not read block 0 in file "base/16509/17869": read only 0 of 81= 92 bytes The file does exist on the file system, with zero bytes, as do the associate= d fsm and vm files. PostGres does allow us to describe the table: \d ApprovalStageDefinition; Table "public.approvalstagedefinition" Column | Type | Collation | Nullable | Default -------------------+--------+-----------+----------+--------- stageid | bigint | | not null | stagename | citext | | not null | internalstagename | citext | | not null | Indexes: "approvalstagedef_pk" PRIMARY KEY, btree (stageid) "approvalstagedefinition_uk1" UNIQUE CONSTRAINT, btree (stagename) "approvalstagedefinition_uk2" UNIQUE CONSTRAINT, btree (internalstagenam= e) Check constraints: "approvalstagedefinition_internalstagename_c" CHECK (length(internalstag= ename::text) <=3D 100) "approvalstagedefinition_stagename_c" CHECK (length(stagename::text) <=3D= 100) Referenced by: TABLE "approvaldetails" CONSTRAINT "approvaldetails_fk5" FOREIGN KEY (st= ageid) REFERENCES approvalstagedefinition(stageid) ON DELETE CASCADE TABLE "currentapprovalstage" CONSTRAINT "currentapprovalst_fk1" FOREIGN K= EY (stageid) REFERENCES approvalstagedefinition(stageid) ON DELETE CASCADE TABLE "serviceapprovermapping" CONSTRAINT "serviceapprovermapping_fk4" FO= REIGN KEY (stageid) REFERENCES approvalstagedefinition(stageid) ON DELETE CA= SCADE Desired Solution: A way to recreate the data file based on the existing schema so that we can t= hen insert the required records. Challenges/Apprehensions: I am a PostGres novice, and reluctant to try dropping the table and recreati= ng it based on the existing schema as I don=E2=80=99t know what else it may b= reak, especially with regards to foreign keys and references. Any constructive advice would be appreciated. Thank you --Apple-Mail-A9CA6106-94E7-47E7-82FD-CA3248A584C8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=EF=BB=BFHi,

While we are looking for a suitable backup to recove= r from, I hope this community may have some other advice on forward steps in= case we cannot restore.

RCA: Unexpected shutdown d= ue to critical power failure

Current Issue: The fil= e base/16509/17869 is zero bytes in size.

Additiona= l Information:
Platform: Windows Server
PostGres Version= : 10.16 (64-bit)

The database does start, and is ot= herwise functioning and working aside from a particular application feature t= hat relies on the lookup of the values in the table that was held in the cur= rently zero-bytes data file.

The non-functioning ta= ble (ApprovalStageDefinition) is a relatively simple table with 5 rows of st= atic data. The contents can easily be recovered with a query such as the fol= lowing for each of the 5 records:
insert into ApprovalStageDefinition values (1, 'Stage One', 'Stage O= ne');

<= /div>
The error message when ru= nning this query is:
ERROR:  could not read block 0 in file "base/16509/17869": read only= 0 of 8192 bytes

The file does exist on the f= ile system, with zero bytes, as do the associated fsm and vm files.

PostGres does allow us to describe the table:
 \d ApprovalStageDefinition;
=
          &= nbsp;Table "public.approvalstagedefinition"
      Column       |  Type &= nbsp;| Collation | Nullable | Default
-------------------+--------+-----------+----------+---------
 stageid       &nbs= p;   | bigint |           | not null |
 stagename       &= nbsp; | citext |           | not null |
 internalstagename | citext |   &= nbsp;       | not null |
Indexes:
    "= approvalstagedef_pk" PRIMARY KEY, btree (stageid)
    "approvalstagedefinition_uk1" UNIQUE CONSTR= AINT, btree (stagename)
  &= nbsp; "approvalstagedefinition_uk2" UNIQUE CONSTRAINT, btree (internalstagen= ame)
Check constraints:
    "approvalstagedefinition= _internalstagename_c" CHECK (length(internalstagename::text) <=3D 100)
    "approvalstagedefin= ition_stagename_c" CHECK (length(stagename::text) <=3D 100)
Referenced by:
    TABLE "approvaldetails" CONSTRAINT "approvalde= tails_fk5" FOREIGN KEY (stageid) REFERENCES approvalstagedefinition(stageid)= ON DELETE CASCADE
   = ; TABLE "currentapprovalstage" CONSTRAINT "currentapprovalst_fk1" FOREIGN KE= Y (stageid) REFERENCES approvalstagedefinition(stageid) ON DELETE CASCADE    TABLE "serviceappr= overmapping" CONSTRAINT "serviceapprovermapping_fk4" FOREIGN KEY (stageid) R= EFERENCES approvalstagedefinition(stageid) ON DELETE CASCADE

Desired Solution:
A way to recreate the data file= based on the existing schema so that we can then insert the required record= s.

Challenges/Apprehensions:
I am a PostG= res novice, and reluctant to try dropping the table and recreating it based o= n the existing schema as I don=E2=80=99t know what else it may break, especi= ally with regards to foreign keys and references.

A= ny constructive advice would be appreciated.

Thank y= ou

= --Apple-Mail-A9CA6106-94E7-47E7-82FD-CA3248A584C8--