Re: Help using pgfsck - Mailing list pgsql-general

From alex b.
Subject Re: Help using pgfsck
Date
Msg-id 3E9C88E3.7040307@gmx.de
Whole thread Raw
In response to Help using pgfsck  ("Vilson farias" <vilson.farias@digitro.com.br>)
List pgsql-general
learning=> CREATE TABLE dates (a timestamp);
CREATE TABLE

learning=> INSERT INTO dates VALUES (now());
INSERT 17647 1


learning=> \d dates
                Table "public.dates"
  Column |            Type             | Modifiers
--------+-----------------------------+-----------
  a      | timestamp without time zone |

learning=> SELECT * FROM dates ;
              a
----------------------------
  2003-04-16 00:28:38.787615
(1 row)


maybe this is, what you are looking for...
well, this doesn't solve your pgfsck problem, but maybe avoids it.

by the way, I couldn't find the type "datetime" as you used it on your
CREATE TABLE..
http://www.postgresql.com/docs/view.php?version=7.3&idoc=0&file=datatype.html




Vilson farias wrote:
> Greetings,
>
>   I've been trying to use pgfsck since my PostgreSQL database was raising a
> "Memory exhausted in
> AllocSetAlloc" but it seems pgfsck is reading my datetimes in a wrong way,
> so I can't export data to recover my database.
>
>   I'd executed initdb with pt_BR (Brazilian's Portuguese language). Is it
> possible to pgfsck problem be related with localization settings?
>
>   Here is my "log" :
>
> bxs=#CREATE TABLE teste(a datetime);
> bxs=#
> bxs=# insert into teste values ( now());
> INSERT 22184 1
> ...
> bxs=# insert into teste values ( now());
> INSERT 22188 1
> bxs=# select * from teste;
>            a
> ------------------------
>  2003-04-14 12:56:35-03
>  2003-04-14 12:56:36-03
>  2003-04-14 12:56:38-03
>  2003-04-14 12:56:39-03
>  2003-04-14 12:56:40-03
>  2003-04-14 12:56:50-03
>  2003-04-14 12:56:51-03
>  2003-04-14 12:56:53-03
>  2003-04-14 12:56:56-03
>  2003-04-14 12:56:58-03
> (10 rows)
>
> bxs=# \q
> [postgres@dgtao ddd]$ ./pgfsck -a -d -D /home/postgres/data bxs teste
> -- Detected database format 7.1
> -- Scanning table teste
> -- Table pg_class(1259):Page 0:Tuple 64: Unknown type _aclitem (1034)
> -- Table pg_class(1259):Page 1:Tuple 0: Unknown type _aclitem (1034)
> -- Table pg_class(1259):Page 1:Tuple 1: Unknown type _aclitem (1034)
> ...
> -- Table pg_class(1259):Page 3:Tuple 20: Unknown type _aclitem (1034)
> -- Table pg_class(1259):Page 3:Tuple 21: Unknown type _aclitem (1034)
> -- Table pg_class(1259):Page 3:Tuple 22: Unknown type _aclitem (1034)
> -- Table teste(22169):Page 0:Tuple 0: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 1: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 2: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 3: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 4: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 5: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 6: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 7: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 8: Unknown type timestamp (1184)
> -- Table teste(22169):Page 0:Tuple 9: Unknown type timestamp (1184)
> insert into teste (a) values ('ÌZ¶~A'); --
> page=0,tuple=0,oid=22179,xmin=1658,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('ÐZ¶~A'); --
> page=0,tuple=1,oid=22180,xmin=1659,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('ØZ¶~A'); --
> page=0,tuple=2,oid=22181,xmin=1660,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('ÜZ¶~A'); --
> page=0,tuple=3,oid=22182,xmin=1661,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('àZ¶~A'); --
> page=0,tuple=4,oid=22183,xmin=1662,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ([¶~A'); --
> page=0,tuple=5,oid=22184,xmin=1664,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('[¶~A'); --
> page=0,tuple=6,oid=22185,xmin=1665,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('[¶~A'); --
> page=0,tuple=7,oid=22186,xmin=1666,xmax=0,cmin=0,cmax=0
> insert into teste (a) values (' [¶~A'); --
> page=0,tuple=8,oid=22187,xmin=1667,xmax=0,cmin=0,cmax=0
> insert into teste (a) values ('([¶~A'); --
> page=0,tuple=9,oid=22188,xmin=1668,xmax=0,cmin=0,cmax=0
>
> After I got this output, I'd reconfigured env with new values and ran pgfsck
> again :
> [postgres@dgtao ddd]$ LANG=pt_BR
> [postgres@dgtao ddd]$ LC_ALL=pt_BR
> [postgres@dgtao ddd]$ LC_CTYPE=pt_BR
> [postgres@dgtao ddd]$ LESSCHARSET=latin1
> [postgres@dgtao ddd]$ export LANG LC_ALL LC_CTYPE
>
> The new test brought the same kind of values. Am I doing somethig wrong?
>
>
> Best regards,
>
> ----------------------------------------------------------------------------
> ----
> José Vilson de Mello de Farias
> Software Engineer
>
> Dígitro Tecnologia Ltda - www.digitro.com.br
> APC - Customer Oriented Applications
> E-mail: vilson.farias@digitro.com.br
> Tel.: +55 48 281 7158
> ICQ 11866179
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>


pgsql-general by date:

Previous
From: Guy Fraser
Date:
Subject: Re: Upgrade to Red Hat Linux 9 broke PostgreSQL
Next
From: Dennis Gearon
Date:
Subject: Re: Postgres Compare