func DeleteServer(ctx context.Context, resourceGroup, serverName string) (resp autorest.Response, err error) {
	serversClient := getServersClient()
	future, err := serversClient.Delete(ctx, resourceGroup, serverName)
	if err != nil {
		return resp, fmt.Errorf("cannot delete the pg server: %+v", err)
	}
	if err := future.WaitForCompletionRef(ctx, serversClient.Client); err != nil {
		return resp, fmt.Errorf("cannot get the pg server update future response: %+v", err)
	}
	return future.Result(serversClient)
}
DeleteServer deletes the PostgreSQL server.
package postgresql
import (
	"context"
	"fmt"
	"github.com/Azure-Samples/azure-sdk-for-go-samples/internal/config"
	"github.com/Azure-Samples/azure-sdk-for-go-samples/internal/iam"
	flexibleservers "github.com/Azure/azure-sdk-for-go/services/preview/postgresql/mgmt/2020-02-14-preview/postgresqlflexibleservers"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/to"
)
func getServersClient() flexibleservers.ServersClient {
	serversClient := flexibleservers.NewServersClient(config.SubscriptionID())
	a, _ := iam.GetResourceManagementAuthorizer()
	serversClient.Authorizer = a
	serversClient.AddToUserAgent(config.UserAgent())
	return serversClient
}
func CreateServer(ctx context.Context, resourceGroup, serverName, dbLogin, dbPassword string) (server flexibleservers.Server, err error) {
	serversClient := getServersClient()
	future, err := serversClient.Create(
		ctx,
		resourceGroup,
		serverName,
		flexibleservers.Server{
			Location: to.StringPtr(config.Location()),
			Sku: &flexibleservers.Sku{
				Name: to.StringPtr("Standard_D4s_v3"),
				Tier: "GeneralPurpose",
			},
			ServerProperties: &flexibleservers.ServerProperties{
				AdministratorLogin:         to.StringPtr(dbLogin),
				AdministratorLoginPassword: to.StringPtr(dbPassword),
				Version:                    flexibleservers.OneTwo,
				StorageProfile: &flexibleservers.StorageProfile{
					StorageMB: to.Int32Ptr(524288),
				},
			},
		})
	if err != nil {
		return server, fmt.Errorf("cannot create pg server: %+v", err)
	}
	if err := future.WaitForCompletionRef(ctx, serversClient.Client); err != nil {
		return server, fmt.Errorf("cannot get the pg server create or update future response: %+v", err)
	}
	return future.Result(serversClient)
}
func UpdateServerStorageCapacity(ctx context.Context, resourceGroup, serverName string, storageCapacity int32) (server flexibleservers.Server, err error) {
	serversClient := getServersClient()
	future, err := serversClient.Update(
		ctx,
		resourceGroup,
		serverName,
		flexibleservers.ServerForUpdate{
			ServerPropertiesForUpdate: &flexibleservers.ServerPropertiesForUpdate{
				StorageProfile: &flexibleservers.StorageProfile{
					StorageMB: &storageCapacity,
				},
			},
		},
	)
	if err != nil {
		return server, fmt.Errorf("cannot update pg server: %+v", err)
	}
	if err := future.WaitForCompletionRef(ctx, serversClient.Client); err != nil {
		return server, fmt.Errorf("cannot get the pg server update future response: %+v", err)
	}
	return future.Result(serversClient)
}