1.126.  tablehasserialkey( text )

Propriétés de la fonction
Langage: PLPGSQL
Type du code retour: boolean

Vérifie que la table a notre colonne spéciale (de type serial) qui est utilisée si la table n'a pas de constrainte unique naturelle.

declare
        p_tab_fqname    alias for $1;
        v_tab_fqname_quoted     text default '';
        v_attnum                int2;
begin
        v_tab_fqname_quoted := slon_quote_input(p_tab_fqname);
        select PGA.attnum into v_attnum
                        from "pg_catalog".pg_class PGC,
                                "pg_catalog".pg_namespace PGN,
                                "pg_catalog".pg_attribute PGA
                        where slon_quote_brute(PGN.nspname) || '.' ||
                                slon_quote_brute(PGC.relname) = v_tab_fqname_quoted
                                and PGC.relnamespace = PGN.oid
                                and PGA.attrelid = PGC.oid
                                and PGA.attname = '_Slony-I_schemadoc_rowID'
                                and not PGA.attisdropped;
        return found;
end;