Repear operations on 50 tables of the same schema?

From: celati Laurent <laurent(dot)celati(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Repear operations on 50 tables of the same schema?
Date: 2023-02-27 11:53:30
Message-ID: CAHByMH36q6OCCKZWJML4vT6cq1aADSi-wghue_7qOcG-tbLcDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good morning,
I am new to Postgresql. I have 50 tables into a "ign" schema (schema other
than public).
I would like for each of these 50 tables:

- Add a prefix to the name of the table: "IGN_bdTopo_"
- Add a suffix to the table name: "_V1"
- create a new "date" column of date type. And populate this field with the
value: 06/15/2021
- create a new "source" column of type varchar (length 50). And populate
this field with the value: 'ign'.
- move all the elements of these 50 tables (including all). from the "ign"
schema to the "ign_v2" schema. Whether data, constraints, indexes.

If someone could help me? Thank you so much.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2023-02-27 12:13:06 Re: ERROR: unsupported Unicode escape sequence - in JSON-type column
Previous Message PALAYRET Jacques 2023-02-27 10:28:17 Re: Interval in hours but not in days Leap second not taken into account