Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1059177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:07:58+00:00 2026-05-16T18:07:58+00:00

PostgreSQL does not allow altering a view (i.e. adding column, changing column orders, adding

  • 0

PostgreSQL does not allow altering a view (i.e. adding column, changing column orders, adding criterie etc.) if it has dependent objects. This is really getting annoying since you have to write a script to:

  1. Drop all the dependent objects,
  2. Alter the view,
  3. Recreate all the dependent objects back again.

I understand that postgreSQL developers have very reasonable concerns to prevent altering views. But do you guys have any scripts/shot-cuts to do all those manual stuff in a single run?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:07:59+00:00Added an answer on May 16, 2026 at 6:07 pm

    Adding new columns isn’t a problem, changing datatypes or changing the order of the columns, that’s where you get problems.

    1. Don’t change the order, it’s not
      that important anyway, just change your query:

      SELECT a, b FROM view_name;

      SELECT b, a FROM view_name;

    2. When you have to change a datatype
      of a column, you have to check the
      depend objects as well. These might
      have problems with this new
      datatype. Just get the definition of
      this object and recreate after the
      changes. The information_schema and
      pg_catalog help you out.

    3. Make all changes within a single
      transaction.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a postgresql database that has this column structure: Author id name Book
Does postgresql allow columns named parent? Neither SELECT id, parent, name FROM address WHERE
I've got an user: user_x that owns a database on postgresql and does not
psql has a -q / --quiet option (environment variable QUIET ). pg_restore does not
.references keyword in Rails migrations does not cause creation of foreign keys in PostgreSQL.
Does anyone know what pg_catalog.setval does? I just did a dump off a PostgreSQL
I'm not used to working with PostgreSQL, but am using Zend_Db_Select to create my
PostgreSQL has announced an Android app contest . I wanted to try out something
Postgresql is not cooperating. I did a yum of postgresql and postgresql-server and that
I want to execute the following update query at PostgreSQL db but it does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.