Thread

  1. Reg. Postgres Unique contraint

    Sajjad Abid <abidsajjad@gmail.com> — 2024-11-27T04:14:36Z

    A column is character varying(50), also on this column a unique
    constraint is defined, but I found some duplicate values in this column for
    some records
      user_name character varying(50)
      CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    
    Kindly help me to resolve this issue.
    
    -- 
    
    
    *Thanks & Regards, Sajjad Abid*
    
  2. Re: Reg. Postgres Unique contraint

    Diomedes Dominguez <diomedes.dominguez@gmail.com> — 2024-11-27T04:18:55Z

    Which version of Postgres are you using?
    
    El mié, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com>
    escribió:
    
    > A column is character varying(50), also on this column a unique
    > constraint is defined, but I found some duplicate values in this column for
    > some records
    >   user_name character varying(50)
    >   CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    >
    > Kindly help me to resolve this issue.
    >
    > --
    >
    >
    > *Thanks & Regards, Sajjad Abid*
    >
    
  3. Re: Reg. Postgres Unique contraint

    Sajjad Abid <abidsajjad@gmail.com> — 2024-11-27T04:27:48Z

    Version of Postgres is 12.9
    
    On Wed, Nov 27, 2024 at 9:49 AM Diomedes Dominguez <
    diomedes.dominguez@gmail.com> wrote:
    
    > Which version of Postgres are you using?
    >
    > El mié, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com>
    > escribió:
    >
    >> A column is character varying(50), also on this column a unique
    >> constraint is defined, but I found some duplicate values in this column for
    >> some records
    >>   user_name character varying(50)
    >>   CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    >>
    >> Kindly help me to resolve this issue.
    >>
    >> --
    >>
    >>
    >> *Thanks & Regards, Sajjad Abid*
    >>
    >
    
    -- 
    
    
    *Thanks & Regards, Sajjad Abid*
    
  4. Re: Reg. Postgres Unique contraint

    Burcin Yazici <burcinyazici@gmail.com> — 2024-11-27T06:22:36Z

    hi,
    
      
    
    
    
      make sure that the values are really duplicated first..
    
    
      
    
    
    
      - check  the collation of column. 
    
    
      - check accent chars exist.
    
    
      - check lowercase, uppercase
    
    
      - check white space, tabs etc.
    
    
      
    
    
    
      
        burcin
      
      
        
    
        
          On 27 Nov 2024, at 07:28, Sajjad Abid <abidsajjad@gmail.com> wrote:
    
          
    
        
      
      
        
          
          
            Version of Postgres is 12.9
          
    
          
            
              On Wed, Nov 27, 2024 at 9:49 AM Diomedes Dominguez <diomedes.dominguez@gmail.com> wrote:
    
            
            
              
    
                Which version of Postgres are you using?
              
    
              
                
                  El mié, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com> escribió:
    
                
                
                  
                    
                      A column is character varying(50), also on this column a unique constraint is defined, but I found some duplicate values in this column for some records
                    
                    
                        user_name character varying(50) 
    
                    
                    
                        CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    
                    
                    
                      
    
                    
                    
                      Kindly help me to resolve this issue.
                    
                    
                      
    
                    --
    
                    
                      Thanks & Regards,
    
                      
    
                      Sajjad Abid
    
                    
                  
                
              
            
          
          
            
    
          
          
            
    
          --
    
          
            Thanks & Regards,
    
            
    
            Sajjad Abid
    
          
        
      
    
    
  5. Re: Reg. Postgres Unique contraint

    Vitalii Tymchyshyn <vit@tym.im> — 2024-11-27T07:13:03Z

    We saw it when OS image changed resulting in collation library change, so
    index lookups started to fail and reindex was needed to fix it.
    
    ср, 27 лист. 2024 р. о 16:23 Burcin Yazici <burcinyazici@gmail.com> пише:
    
    > hi,
    >
    > make sure that the values are really duplicated first..
    >
    > - check  the collation of column.
    > - check accent chars exist.
    > - check lowercase, uppercase
    > - check white space, tabs etc.
    >
    > burcin
    >
    > On 27 Nov 2024, at 07:28, Sajjad Abid <abidsajjad@gmail.com> wrote:
    >
    > 
    >
    > Version of Postgres is 12.9
    >
    > On Wed, Nov 27, 2024 at 9:49 AM Diomedes Dominguez <
    > diomedes.dominguez@gmail.com> wrote:
    >
    >> Which version of Postgres are you using?
    >>
    >> El mié, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com>
    >> escribió:
    >>
    >>> A column is character varying(50), also on this column a unique
    >>> constraint is defined, but I found some duplicate values in this column for
    >>> some records
    >>>   user_name character varying(50)
    >>>   CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    >>>
    >>> Kindly help me to resolve this issue.
    >>>
    >>> --
    >>>
    >>>
    >>> *Thanks & Regards, Sajjad Abid*
    >>>
    >>
    >
    > --
    >
    >
    > *Thanks & Regards, Sajjad Abid*
    >
    >
    
  6. RE: Reg. Postgres Unique contraint

    msalais@msym.fr — 2024-12-27T11:54:52Z

    Hi,
    
     
    
    Does the following query return something:
    
     
    
    Select user_name, count(*) from your_table group by user_name having count(*) > 1
    
     
    
    Best regards
    
     
    
    Michel SALAIS
    
     
    
    De : Sajjad Abid <abidsajjad@gmail.com> 
    Envoyé : mercredi 27 novembre 2024 05:28
    À : Diomedes Dominguez <diomedes.dominguez@gmail.com>
    Cc : pgsql-performance@lists.postgresql.org
    Objet : Re: Reg. Postgres Unique contraint
    
     
    
    Version of Postgres is 12.9
    
     
    
    On Wed, Nov 27, 2024 at 9:49 AM Diomedes Dominguez <diomedes.dominguez@gmail.com <mailto:diomedes.dominguez@gmail.com> > wrote:
    
    Which version of Postgres are you using? 
    
     
    
    El mié, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com <mailto:abidsajjad@gmail.com> > escribió:
    
    A column is character varying(50), also on this column a unique constraint is defined, but I found some duplicate values in this column for some records
    
      user_name character varying(50) 
    
      CONSTRAINT  user_name_unq   UNIQUE ( user_name )
    
     
    
    Kindly help me to resolve this issue.
    
     
    
    -- 
    
    Thanks & Regards, 
    
    Sajjad Abid
    
    
    
    
     
    
    -- 
    
    Thanks & Regards, 
    
    Sajjad Abid
    
    
  7. Re: Reg. Postgres Unique contraint

    shammat@gmx.net — 2024-12-27T12:57:59Z

    Am 27.11.24 um 05:14 schrieb Sajjad Abid:
    > A column is character varying(50), also on this column a unique
    > constraint is defined, but I found some duplicate values in this
    > column for some records user_name character varying(50) CONSTRAINT
    > user_name_unq   UNIQUE ( user_name )
    
    Most likely a locale/encoding problem.
    
    See: https://wiki.postgresql.org/wiki/Locale_data_changes