rename table between schema with one command

From: Alex <zhihui(dot)fan1213(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: rename table between schema with one command
Date: 2019-07-25 04:52:06
Message-ID: CAKU4AWraGbRNBrS=kO2e8cK1TGoK8vuBz+YN_tiX6PFO3+91-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

for example we have table t1 under schema s1. can I rename it to s2.t2
with one command.

currently I can do:

alter table s1.t1 set schema s2;
alter table s2.t1 rename to t2.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guyren Howe 2019-07-25 05:52:33 Re: Request for resolution || Support
Previous Message Adrian Klaver 2019-07-24 21:38:50 Re: Running concurrent txns and measuring the timings in Postgres