Search
 
SCRIPT & CODE EXAMPLE
 

SQL

psql change table schema

ALTER TABLE myschema.distributors SET SCHEMA yourschema;
Comment

change schema of all tables postgres

DO
$$DECLARE
   p_table regclass;
BEGIN
   SET LOCAL search_path='xyz';
   FOR p_table IN
      SELECT oid FROM pg_class
      WHERE relnamespace = 'xyz'::regnamespace
        AND relkind = 'r'
   LOOP
      EXECUTE format('ALTER TABLE %s SET SCHEMA public', p_table);
   END LOOP;
END;$$;
Comment

PREVIOUS NEXT
Code Example
Sql :: list foreign key oracle 
Sql :: what is non relational database 
Sql :: export mysql table to file 
Sql :: how to open mysql in docker 
Sql :: python get backup of sql 
Sql :: oracle db timestamp auto add 
Sql :: SQL order by string split length 
Sql :: sqlite modify row 
Sql :: replace content value from old to new sql 
Sql :: mysql search replace 
Sql :: Split JSON data in SQL Server column 
Sql :: update row postgres 
Sql :: C# mysql data reader from two tables 
Sql :: how to generate ids in sql 
Sql :: select only distinct values another table 
Sql :: coalesce function in sql server 
Sql :: mysql string split to array 
Sql :: connect by query in oracle 
Sql :: left join in sql oracle 
Sql :: select count concat string sql server 
Sql :: mysql bind-address default value 
Sql :: sqlcmd no headers 
Sql :: psql concat string and int 
Sql :: mssql default connection string 
Sql :: last date for each user sql 
Sql :: rownum in sql 
Sql :: oracle logfile switch 
Sql :: what is subquery in sql 
Sql :: redirection 301 htaccess nom de domaine 
Sql :: sql date between one week 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =