Must re-connect to see tables

From: Blake McBride <blake(at)mcbride(dot)name>
To: pgsql-general(at)postgresql(dot)org
Subject: Must re-connect to see tables
Date: 2018-03-27 11:22:17
Message-ID: CABwHSOs=5obj-B=dELLh6FxiGeAdqHZb259WkDi7oR3JUH-t0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have been using PostgreSQL for many years but all of a sudden a db load
script I've been using no longer works. What id does (essentially) is:

psql postgres postgres
drop database test;
create database test;
\c test
\i data.sql
\dt
\q

I tested this with a small data.sql and it worked fine. However, when I
use a real (much larger) data.sql then \dt replies "No relations" ! I
found this if I stick an extra '\c test' after the '\i data.sql' it works.

The data.sql is a PostgreSQL dump from another database. When the '\i
data.sql' is done, the prompt still shows 'test#' so it's not like I've
changed databases.

I only have one schema, 'public'.

Can't figure out why a simple example works but a large file requires an
extra \c.

Sure appreciate any help.

Blake McBride

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Blake McBride 2018-03-27 11:23:26 Re: Must re-connect to see tables
Previous Message Johann Spies 2018-03-27 10:22:25 Using Lateral