Re: rename table between schema with one command - Mailing list pgsql-general

From David G. Johnston
Subject Re: rename table between schema with one command
Date
Msg-id CAKFQuwYrSGZkbEzJOvoROFjSg=Yh7HumJaLgZj-FvqZzQ3ewaQ@mail.gmail.com
Whole thread Raw
In response to rename table between schema with one command  (Alex <zhihui.fan1213@gmail.com>)
List pgsql-general
On Wednesday, July 24, 2019, Alex <zhihui.fan1213@gmail.com> wrote:
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. 

No.  AFAIK alter table is the obly sql command that can do those things and the syntax does not provide a way to combine the two into a single executable command.

Out of curosity, why do you ask?

David J.

pgsql-general by date:

Previous
From: Guyren Howe
Date:
Subject: Re: Request for resolution || Support
Next
From: Cyril Champier
Date:
Subject: Re: Default ordering option