Re: Help using pgfsck

From: "alex b(dot)" <mailinglists1(at)gmx(dot)de>
To: Vilson farias <vilson(dot)farias(at)digitro(dot)com(dot)br>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help using pgfsck
Date: 2003-04-15 22:34:11
Message-ID: 3E9C88E3.7040307@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)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(at)dgtao ddd]$ LANG=pt_BR
> [postgres(at)dgtao ddd]$ LC_ALL=pt_BR
> [postgres(at)dgtao ddd]$ LC_CTYPE=pt_BR
> [postgres(at)dgtao ddd]$ LESSCHARSET=latin1
> [postgres(at)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(dot)farias(at)digitro(dot)com(dot)br
> Tel.: +55 48 281 7158
> ICQ 11866179
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-15 22:38:53 Re: Postgres Compare
Previous Message Guy Fraser 2003-04-15 22:26:46 Re: Upgrade to Red Hat Linux 9 broke PostgreSQL