# PostaResource.WithPostgresReference

- Module: [CommunityToolkit.Aspire.Hosting.Posta](/reference/api/go/communitytoolkit.aspire.hosting.posta.md)
- Defined on: [PostaResource](/reference/api/go/communitytoolkit.aspire.hosting.posta/postaresource.md)
- Version: `13.6.1`
- Kind: `method`

Configures the PostgreSQL database used by Posta.

## Definition

```go
type PostaResource interface {
    // ... omitted for brevity
    WithPostgresReference(database PostgresDatabaseResource) PostaResource
}
```

## Signature

```go
WithPostgresReference(database PostgresDatabaseResource) PostaResource
```

## Parameters

- `database` ([`PostgresDatabaseResource`](/reference/api/go/communitytoolkit.aspire.hosting.posta/postgresdatabaseresource.md)) -- The PostgreSQL database resource used by Posta.

## Returns

[`PostaResource`](/reference/api/go/communitytoolkit.aspire.hosting.posta/postaresource.md) -- A reference to the `IResourceBuilder` for further resource configuration.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [PostaResource](/reference/api/go/communitytoolkit.aspire.hosting.posta/postaresource.md) -- `handle`
