Redundant data in postgres

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lynux
    New Member
    • Feb 2007
    • 1

    Redundant data in postgres

    Hye,

    I'm quite new in postgres.I have 2 problems that i do not how to solve. Hope somebody can help me.

    1. Although i put my zone field is unique, postgres sometimes redundant my
    data automatically.E xample :
    -----------------------------------
    rundate | zone
    -----------------------------------
    01/30/2007 | #01
    -----------------------------------
    01/30/2007 | #01
    -----------------------------------

    2. Why does when i make a select statement like this
    'select runndate,zone from tb_team_arch where rundate='30 January 2007' , postgres give me data like this
    -----------------------------------
    rundate | zone
    -----------------------------------
    01/30/2007 | #01
    -----------------------------------
    11/02/2007 | #01
    -----------------------------------

    This result make my system goes wrong.
    I really hope somebody can help me
    Thank you
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    This is highly unlikely that Postgres would allow a duplicate data on a unique field.
    Could you review the table definition?
    If you're not sure you can post it here. If you don't have any management tools, then the easiest way to get the table schema and constraints is to open the psql session and enter this command:

    Code:
    \d table_name
    -- or
    \d+ table_name

    Comment

    Working...