pg_dump/PgAdmin problem?

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: pg_dump/PgAdmin problem?
Date: 2002-01-29 20:45:04
Message-ID: 002501c1a905$d596e050$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was wondering if anyone else had problems using pg_dump on database with
PgAdmin. Specifically, if I do a pg_dump and then run the output back
through psql, it gives me the following errors:

psql:cns.sql:3697: ERROR: parser: parse error at or near "."
psql:cns.sql:3705: ERROR: Relation 'pgadmin_sequences' does not exist
psql:cns.sql:3706: ERROR: Relation 'pgadmin_sequences' does not exist
psql:cns.sql:3707: ERROR: Relation 'pgadmin_sequences' does not exist
psql:cns.sql:3715: ERROR: parser: parse error at or near "."
psql:cns.sql:3723: ERROR: Relation 'pgadmin_tables' does not exist
psql:cns.sql:3724: ERROR: Relation 'pgadmin_tables' does not exist
psql:cns.sql:3725: ERROR: Relation 'pgadmin_tables' does not exist

I've tracked down the problem and it seems it doesn't like two view
definitions (pgadmin_sequences and pgadmin_tables), and therefore the
subsequent GRANTs. The views are at the end of the email.

This hadn't been a huge problem for me (especially since I don't personally
use PgAdmin), but it worries me that I can't fully restore a database from a
backup. Has anyone else experienced this?

version
---------------------------------------------------------------------
PostgreSQL 7.1.3 on i386-unknown-freebsd4.3, compiled by GCC 2.95.3

Greg

CREATE VIEW "pgadmin_sequences" as SELECT c.oid AS sequence_oid, c.relname
AS sequence_name, pg_get_userbyid(c.relowner) AS sequence_owner, c.relacl AS
sequence_acl, pgadmin_get_sequence(c.oid).sequence_last_value AS
sequence_last_value, pgadmin_get_sequence(c.oid).sequence_increment_by AS
sequence_increment_by, pgadmin_get_sequence(c.oid).sequence_max_value AS
sequence_max_value, pgadmin_get_sequence(c.oid).sequence_min_value AS
sequence_min_value, pgadmin_get_sequence(c.oid).sequence_cache_value AS
sequence_cache_value, pgadmin_get_sequence(c.oid).sequence_is_cycled AS
sequence_is_cycled, CASE WHEN (c.oid <= 18655) THEN
pgadmin_get_pgdesc(c.oid) ELSE pgadmin_get_desc(c.oid) END AS
sequence_comments FROM pg_class c WHERE (c.relkind = 'S'::"char");

CREATE VIEW "pgadmin_tables" as SELECT c.oid AS table_oid, c.relname AS
table_name, pg_get_userbyid(c.relowner) AS table_owner, c.relacl AS
table_acl, CASE WHEN (c.relhasindex = 't'::bool) THEN 'Yes'::text ELSE
'No'::text END AS table_has_indexes, CASE WHEN (c.relhasrules = 't'::bool)
THEN 'Yes'::text ELSE 'No'::text END AS table_has_rules, CASE WHEN
(c.relisshared = 't'::bool) THEN 'Yes'::text ELSE 'No'::text END AS
table_is_shared, CASE WHEN (c.relhaspkey = 't'::bool) THEN 'Yes'::text ELSE
'No'::text END AS table_has_primarykey, CASE WHEN (c.reltriggers > 0) THEN
'Yes'::text ELSE 'No'::text END AS table_has_triggers,
pgadmin_get_rows(c.oid).table_rows AS table_rows, CASE WHEN (c.oid <= 18655)
THEN pgadmin_get_pgdesc(c.oid) ELSE pgadmin_get_desc(c.oid) END AS
table_comments, a.oid AS column_oid, a.attname AS column_name, a.attnum AS
column_position, t.typname AS column_type, CASE WHEN ((a.attlen = -1) AND
(a.atttypmod = -1)) THEN 0 ELSE CASE WHEN (a.attlen = -1) THEN CASE WHEN
(((t.typname = 'bpchar'::name) OR (t.typname = 'char'::name)) OR (t.typname
= 'varchar'::name)) THEN (a.atttypmod - 4) ELSE a.atttypmod END ELSE
int4(a.attlen) END END AS column_length, CASE WHEN (a.attnotnull =
't'::bool) THEN 'Yes'::text ELSE 'No'::text END AS column_not_null, CASE
WHEN (a.atthasdef = 't'::bool) THEN 'Yes'::text ELSE 'No'::text END AS
column_has_default, CASE WHEN (pgadmin_get_col_def(c.oid, int4(a.attnum))
NOTNULL) THEN pgadmin_get_col_def(c.oid, int4(a.attnum)) ELSE ''::text END
AS column_default, CASE WHEN (a.oid <= 18655) THEN pgadmin_get_pgdesc(a.oid)
ELSE pgadmin_get_desc(a.oid) END AS column_comments FROM pg_attribute a,
pg_type t, pg_class c WHERE (((a.atttypid = t.oid) AND (a.attrelid = c.oid))
AND (((bpchar(c.relkind) = 'r'::bpchar) OR (bpchar(c.relkind) = 's'::bpchar
)) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE
((pg_rewrite.ev_class = c.oid) AND (bpchar(pg_rewrite.ev_type) =
'1'::bpchar)))))));

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-01-29 21:38:08 Re: outer joins complexity
Previous Message David Link 2002-01-29 20:32:27 Re: Upgrade 7.0.3 -> 7.1.3 problems!