You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fmt.Fprint(b, " VERSION ", pq.QuoteIdentifier(v.(string)))
72
+
}
73
+
63
74
query:=b.String()
64
75
_, err=conn.Query(query)
65
76
iferr!=nil {
@@ -80,8 +91,8 @@ func resourcePostgreSQLExtensionRead(d *schema.ResourceData, meta interface{}) e
80
91
deferconn.Close()
81
92
82
93
extID:=d.Id()
83
-
varextName, extSchemastring
84
-
err=conn.QueryRow("SELECT e.extname, n.nspnameFROM pg_catalog.pg_extension e, pg_catalog.pg_namespace n WHERE n.oid = e.extnamespace AND e.extname = $1", extID).Scan(&extName, &extSchema)
94
+
varextName, extSchema, extVersionstring
95
+
err=conn.QueryRow("SELECT e.extname, n.nspname, e.extversion FROM pg_catalog.pg_extension e, pg_catalog.pg_namespace n WHERE n.oid = e.extnamespace AND e.extname = $1", extID).Scan(&extName, &extSchema, &extVersion)
85
96
switch {
86
97
caseerr==sql.ErrNoRows:
87
98
log.Printf("[WARN] PostgreSQL extension (%s) not found", d.Id())
@@ -92,6 +103,7 @@ func resourcePostgreSQLExtensionRead(d *schema.ResourceData, meta interface{}) e
92
103
default:
93
104
d.Set(extNameAttr, extName)
94
105
d.Set(extSchemaAttr, extSchema)
106
+
d.Set(extVersionAttr, extVersion)
95
107
d.SetId(extName)
96
108
returnnil
97
109
}
@@ -132,6 +144,10 @@ func resourcePostgreSQLExtensionUpdate(d *schema.ResourceData, meta interface{})
0 commit comments