@@ -25,7 +25,6 @@ func resourcePostgreSQLSecurityLabel() *schema.Resource {
2525 Read : PGResourceFunc (resourcePostgreSQLSecurityLabelRead ),
2626 Update : PGResourceFunc (resourcePostgreSQLSecurityLabelUpdate ),
2727 Delete : PGResourceFunc (resourcePostgreSQLSecurityLabelDelete ),
28- // Exists: PGResourceExistsFunc(resourcePostgreSQLSecurityLabelExists),
2928 Importer : & schema.ResourceImporter {
3029 StateContext : schema .ImportStatePassthroughContext ,
3130 },
@@ -77,38 +76,6 @@ func resourcePostgreSQLSecurityLabelCreate(db *DBConnection, d *schema.ResourceD
7776 return resourcePostgreSQLSecurityLabelReadImpl (db , d )
7877}
7978
80- // func resourcePostgreSQLSecurityLabelExists(db *DBConnection, d *schema.ResourceData) (bool, error) {
81- // if !db.featureSupported(featureSecurityLabel) {
82- // return false, fmt.Errorf(
83- // "Security Label is not supported for this Postgres version (%s)",
84- // db.version,
85- // )
86- // }
87- // log.Printf("[WARN] PostgreSQL security label Exists")
88-
89- // id := strings.Split(d.Id(), ".")
90- // if len(id) != 3 {
91- // return false, fmt.Errorf(
92- // "Invalid ID: %s. ID should be in the format of %s.%s.%s",
93- // d.Id(),
94- // securityLabelProviderAttr,
95- // securityLabelObjectTypeAttr,
96- // securityLabelObjectNameAttr,
97- // )
98- // }
99-
100- // provider := id[0]
101- // objectType := id[1]
102- // objectName := id[2]
103- // query := "SELECT objtype FROM pg_seclabels WHERE objtype = $1 and objname = $2 and provider = $3"
104- // err := db.QueryRow(query, objectType, quoteIdentifier(objectName), quoteIdentifier(provider)).Scan(&objectType)
105- // if err == sql.ErrNoRows || err != nil {
106- // return false, err
107- // }
108-
109- // return true, nil
110- // }
111-
11279func resourcePostgreSQLSecurityLabelUpdateImpl (db * DBConnection , d * schema.ResourceData , label string ) error {
11380 b := bytes .NewBufferString ("SECURITY LABEL " )
11481
0 commit comments