Problem parsing functions makes PgSQL Restore impossible - Mailing list pgsql-general

From sth@bsbg.net (Stefan Hadjistoytchev)
Subject Problem parsing functions makes PgSQL Restore impossible
Date
Msg-id 6ffcbdfe.0111241557.c63842f@posting.google.com
Whole thread Raw
List pgsql-general
Hi!

I think I found a problem (bug?) in PgSQL:

If there is a:

<functionA>( <functionB> ( args...) )

in a CREATE VIEW, PgSQL then translates it as:
<functionB> ( args... ).<functionB>.

This makes 'pg_dump' generate invalid Views and thus Views could not
be restored afterwards :(

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EXAMPLE taken (part of a real View) from PgAdmin views:

1. Written:
CREATE VIEW test AS SELECT
sequence_last_value(pgadmin_get_sequence(c.oid)) AS
sequence_last_value FROM pg_class c;

2. pg_dump generates ?!?:
CREATE VIEW test AS SELECT
pgadmin_get_sequence(c.oid).sequence_last_value AS sequence_last_value
FROM pg_class c;
NOTE: PgAdmin also shows the same data!

3. psql restores data generated by pg_dump and produces an error:
ERROR:  parser: parse error at or near "."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BACKGROUND:
I user PostgreSQL 7.1.3 and PgAdmin 7.1.0 (both latest versions I
hope);

After PgAdmin openes a database it usually creates a number of system
Tables and Views that start with 'pgadmin_'.

After a pg_dump is made on such a database and then restored
2 errors appeare in CREATE VIEW part as discribed above.
Errors are during creation of VIEWS named 'pgadmin_sequences' and
'pgadmin_tables'.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QUESTION:
What should I do to successfully Backup & Restore these (or such type)
of Views?

Best regards
sth

pgsql-general by date:

Previous
From: shield123321@hotmail.com
Date:
Subject: Setting up MAKE file for Postgres and C++/Newbie question
Next
From: sara_software@hotmail.com (sara_software)
Date:
Subject: Rule