Skip to content

Instantly share code, notes, and snippets.

@francois
Created March 4, 2017 14:49
Show Gist options
  • Save francois/2db220bd197492d02e0b60224a7576ac to your computer and use it in GitHub Desktop.
Save francois/2db220bd197492d02e0b60224a7576ac to your computer and use it in GitHub Desktop.
$ psql --version
psql (PostgreSQL) 9.6.2
$ psql -h localhost
psql (9.6.2)
francois@localhost francois # select version();
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.6.2 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.42.1), 64-bit
francois@localhost francois # set search_path to public;
francois@localhost francois # \dt
List of relations
Schema | Name | Type | Owner
--------+-------------+-------+----------
public | event_types | table | francois
public | events | table | francois
public | families | table | francois
francois@localhost francois # set search_path to mybank;
francois@localhost francois # \dt
List of relations
Schema | Name | Type | Owner
--------+----------+-------+----------
mybank | families | table | francois
francois@localhost francois # set search_path to mybank, public;
francois@localhost francois # \dt
List of relations
Schema | Name | Type | Owner
--------+-------------+-------+----------
mybank | families | table | francois
public | event_types | table | francois
public | events | table | francois
create schema mybank;
create table public.a();
create table mybank.a();
set search_path to public;
\dt
set search_path to mybank;
\dt
set search_path to mybank, public;
\dt
set search_path to public, mybank;
\dt
$ psql --no-psqlrc --quiet repro -f b.sql
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | francois
(1 row)
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
mybank | a | table | francois
(1 row)
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
mybank | a | table | francois
(1 row)
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | francois
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment