Re: [BUGS] I can't start postgres anymore
Fabien Fischer <[EMAIL PROTECTED]> writes: > DEBUG: database system was interrupted being in recovery at 2002-11-07 > 14:12:46 CET > This probably means that some data blocks are corrupted > and you will have to use the last backup for recovery. > DEBUG: invalid resource manager id in primary checkpoint record > DEBUG: using previous checkpoint record at 0/7039D94 > DEBUG: redo record is at 0/7039D94; undo record is at 0/0; shutdown TRUE > DEBUG: next transaction id: 473535; next oid: 166062 > DEBUG: database system was not properly shut down; automatic recovery in > progress > DEBUG: redo starts at 0/7039DD4 > FATAL 2: btree_insert_redo: failed to add item > DEBUG: startup process (pid 1805) exited with exit code 2 > DEBUG: aborting startup due to startup process failure Looks like a mess :-( What led up to this? System crash maybe? It would be interesting to study your WAL logs and try to understand what happened, but unless you want to let someone into your machine to poke around, or donate a tarball of your whole $PGDATA tree for study, we pnobably can't learn much. As far as getting back on the air is concerned: I'd suggest running contrib/pg_resetxlog and then doing a pg_dumpall, initdb, restore. > My Linux-version is : > -Linux version 2.4.2-2 ([EMAIL PROTECTED]) > (gcc version 2.96 2731 (Red Hat Linux 7.1 2.96-79)) > My Postgresql version is the binary: > - postgresql 7.2 I'd suggest updating to PG 7.2.3. RHL 7.1 is a tad obsolete as well. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [BUGS] pg_ctl is fragile
Neil Conway writes: > Tom Lane <[EMAIL PROTECTED]> writes: > > Doesn't seem like kill's exit code is going to tell you enough. > > If you got, say, "Permission denied" rather than "No such process", > > you shouldn't report that the postmaster isn't running. > > Ok, fair enough -- so is there any way to improve this behavior? Merge pg_ctl and postmaster executables. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[BUGS] copy works, \copy doesn't
Sorry for the duplicate post. I forgot to mention this is with Postgresql 7.2.2. It seems the psql \copy command doesn't work properly when dealing with certain non-ascii characters (which ones I don't know). At any rate I took some binary data and escaped it like so with perl. $text=~s/\\//g; $text=~s/\n/\\\n/g; $text=~s/\t/\\\t/g; In other words I escaped escape characters, newlines and tabs. I made a table like this CREATE TABLE "testtable" ( "somenumber" integer DEFAULT '0' NOT NULL, "sometext" text DEFAULT '' NOT NULL ); I made my input file by printing out a asciified number, a tab, the text above and a newline. This is the attached file. In the event attached files get stripped by the mailing list it is also at http://www.aracnet.com/~paulb/sample-data When I do copy testtable from '/home/paulb/sample-data'; it works fine. When I do \copy testtable from '/home/paulb/sample-data' I get ERROR: copy: line 2, pg_atoi: error in "(binary gobbledygook) sample-data Description: Binary data ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[BUGS] I was wrong about Re: copy works, \copy doesn't (fwd)
I wrote: > It seems the psql \copy command doesn't work properly when dealing > with certain non-ascii characters (which ones I don't know). At any rate > I took some binary data and escaped it like so with perl. I was wrong. I wasn't escaping things properly; in particular, ascii 0 needed to be escaped to \\000 . Also I was using 'text' type instead of 'bytea' type. I thought 'copy' was working but it was actually cutting off my input at the first ascii zero, whereas \copy gave me the error message. Sorry to waste people's time. In the event anyone else is out there who wants to use binary data with 'copy from' and is using perl to do the escaping this seems to work. # double up the escape character twice! Once for the 'copy from' command and # once for postgres bytea type escaping. $text=~s/\\//g; $text=~s/\n/\\\n/g; # escape \n $text=~s/\t/\\\t/g; # escape \t $text=~s/'/\\'/g; # escape ' $text=~s/\x00/000/g;# escape ascii 0 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])