Len Morgan wrote:
>
> I am trying to copy a table from my local database to a client's. The
> problem is I keep getting a message from pg_dump:
>
> "can't find template1 database. You are really hosed."
>
> The docs say that this usually means the postmaster is not running but it
> is. In fact, I can get into the database and do whatever I want to with it.
> Over the weekend I did try and install the 7.0.2 RPMS without much luck. I
> uninstalled them and reinstalled 6.5.1-3. I then reloaded my databases.
> This is the first time I've done a pg_dump since. pg_dumpall gives me the
> same error.
>
> If you've got any advice on how I can save these two tables I need so I can
> get them to my customer I'd appreciate it.
>
> Redhat 6.0 OS
>
> len morgan
In 6.x, pg_database sometimes became out of sync. Perform a:
SELECT oid, * FROM pg_database;
That error is usually a symptom of either a missing entry for
template1 or a duplicate entry. If it is missing, you'll have to
add the record yourself with an insert:
INSERT INTO pg_database VALUES ('template1', 100, 0,
'template1');
If there are duplicates, delete the duplicate:
DELETE FROM pg_database WHERE oid = X;
where 'X' is the oid of the duplicate.
Hope that helps,
Mike Mascari