diff --git a/cargo-pgx/src/commands/install.rs b/cargo-pgx/src/commands/install.rs index 279dc5579..3e4f69760 100644 --- a/cargo-pgx/src/commands/install.rs +++ b/cargo-pgx/src/commands/install.rs @@ -158,8 +158,8 @@ fn copy_sql_files(extdir: &PathBuf, extname: &str, base_directory: &PathBuf) { let filename = sql.file_name().into_string().unwrap(); if filename.starts_with(&format!("{}--", extname)) && filename.ends_with(".sql") { - let mut dest = PathBuf::new(); - dest.push(&extdir); + let mut dest = base_directory.clone(); + dest.push(extdir); dest.push(filename); copy_file(sql.path(), dest, "extension schema file");