Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostgreSQL 9 Administration Cookbook - Second Edition
  • Table Of Contents Toc
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

By : Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini
5 (3)
close
close
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

5 (3)
By: Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini

Overview of this book

Through example-driven recipes, with plenty of code, focused on the most vital features of the latest PostgreSQL version (9.4), both administrators and developers will follow short, specific guides to understand and leverage useful Postgre functionalities to create better and more efficient databases.
Table of Contents (14 chapters)
close
close
13
Index

Moving objects between schemas


Once you've created schemas for administration purposes, you'll want to move existing objects to keep things tidy.

How to do it…

To move one table from its current schema to a new schema, use the following:

ALTER TABLE cust
SET SCHEMA anotherschema;

If you want to move all objects, you can consider renaming the schema itself, using the following query:

ALTER SCHEMA existingschema RENAME TO anotherschema;

This only works if another schema with that name does not exist. Otherwise, you'll need to run ALTER TABLE for each table you want to move. You can use this recipe to perform the same action on many tables to achieve that.

Views, sequences, functions, aggregates, and domains can also be moved by ALTER commands with SET SCHEMA options.

How it works…

When you move tables to a new schema, all the indexes, triggers, and rules defined on those tables will also be moved to the new schema. If you've used a SERIAL data type and an implicit sequence has been created, then...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostgreSQL 9 Administration Cookbook - Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon