SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    San Francisco
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Postgres: Do views update along with table data?

    If I create a view based on a table or tables, does that view get automatically updated when the original data is updated? Or is a view more of a snapshot of the data at the instance of its creation?

    I've poked around the postgres.org documentation, but was not able to find a definitive answer. I suspect there may be something simple I am missing.

    Many thanks!

  2. #2
    Non-Member DaveMichaels's Avatar
    Join Date
    Nov 2004
    Location
    US
    Posts
    535
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Views don't create any "snapshots" of data or get "updated" - they're just a facade to the underlying queries on the actual tables.

  3. #3
    SitePoint Member wharding's Avatar
    Join Date
    Jan 2005
    Location
    North Haledon, NJ
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A view is a mask that is applied to a table / set of tables / set of databases in order to make retrieval easier. In many cases retrieval times can be decreased with the use of a view because the db engine (query engine) can analyze and predict better what indexes to use.

    Also I know that in Oracle (not sure about Postgres) You can join tables in totally seperate databases (even if they are on different servers) with the use of views.

    But I digress
    WJ Harding - CTO
    Negative ... I am a meat popsicle
    design | SEO | java hosting


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •