Re: [HACKERS] pg_dump

From: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
To: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] pg_dump
Date: 1999-06-01 12:37:13
Message-ID: 3753D3F9.4739462D@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck wrote:

> > I'm convinced that pg_dump / psql restore doesn't seem to restore VIEWs
> > properly. Anybody else seen this?
>
> More details please!

It seems to be extremely easy to reproduce...

chris=> create table foo(a int4, b int4);
CREATE
chris=> insert into foo values(3, 4);
INSERT 1484426 1
chris=> create view bar as SELECT a + b FROM foo;
CREATE
chris=> select * from bar;
?column?
--------
7
(1 row)

EOFis=>
chris(at)tech!26!bash:~$ pg_dump chris -o >foo
chris(at)tech!27!bash:~$ createdb foobar
chris(at)tech!28!bash:~$ psql !$ <foo
psql foobar <foo
CREATE TABLE pgdump_oid (dummy int4);
CREATE
COPY pgdump_oid WITH OIDS FROM stdin;
DROP TABLE pgdump_oid;
DROP
CREATE TABLE "foo" (
"a" int4,
"b" int4);
CREATE
CREATE TABLE "bar" (
"?column?" int4);
CREATE
COPY "foo" WITH OIDS FROM stdin;
CREATE RULE "_RETbar" AS ON SELECT TO "bar" WHERE DO INSTEAD SELECT "a"
+ "b" F
ROM "foo";
ERROR: parser: parse error at or near "do"
EOF
chris(at)tech!29!bash:~$ psql foobar
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.0 on i686-pc-linux-gnu, compiled by gcc 2.7.2.3]

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: foobar

foobar=> select * from foo;
a|b
-+-
3|4
(1 row)

foobar=> select * from bar;
?column?
--------
(0 rows)

foobar=>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-06-01 14:07:43 Re: [SQL] Column name's length
Previous Message Jan Wieck 1999-06-01 12:20:35 Re: [HACKERS] pg_dump