Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:33:43+00:00 2026-05-24T06:33:43+00:00

I am using psql 8.1.18 on Glassfishserver. I have a query like this: select

  • 0

I am using psql 8.1.18 on Glassfishserver. I have a query like this:

select ip,round((select sum(t1.size) from table t1)) 
from table 
where date > '2011.07.29' 
and date < '2011.07.30' 
and ip = '255.255.255.255' 
group by ip;

When I run this query I got this error:

ERROR:  could not read block 4707 of relation 1663/16384/16564: Success

However this query works fine:

select ip,round(sum(size)/175) 
from table 
where date > '2011.07.29' 
and l_date < '2011.07.30' 
and ip = '255.255.255.255' 
group by ip;

I think it might be a database error and I need to restore the table from the backup, maybe. But first I need to learn where this corrupted data exist. Does anyone know how to find 1663/16384/16564 relation? Or 4707 block?

EDIT:
I tried this code:

select relname , relfilenode from pg_class where  relname in ('1663','16384','16564');

but it returns:

relname | relfilenode 
---------+-------------
(0 rows)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:33:43+00:00Added an answer on May 24, 2026 at 6:33 am

    It looks like there are bad blocks in a table or an index.

    To find the bad data, Maybe you can query pg_class views ;

    select oid,relname from pg_class where oid =1663 or oid=16564;

    just see what’s the result!

    IF the result is an index, just recreate the corrupted index;

    IF the result is a table , than it means that there are some data of the table is damaged,
    you can set the parameter “zero_damaged_pages” to on to by pass those corrupted data or
    restore the table from your recently backup set !

    more information about the parameter “zero_damaged_pages”
    http://www.postgresql.org/docs/9.0/static/runtime-config-developer.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I write PSQL script and using variables (for psql --variable key=value commandline syntax). This
I have a weird problem. I can connect to a remote host using psql
This is my first time using java to access databases, so I probably have
I am using PostgreSQL 8.4 on Ubuntu. I have a table with columns c1
I have created a PostgreSQL database dump using psql . Now I want to
I'm using python and psycopg2 to remotely query some psql databases, and I'm trying
I updated a database table using postgresql from python My code was import psycopg2
Using PHP and MySQL, I want to query a table of postings my users
I am querying a database in Postgres using psql. I have used the following
I'm trying to sort by converted column, but psql returns error: SELECT * FROM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.