# PostgresDatabaseResource Constructors

- Package: [Aspire.Hosting.PostgreSQL](/reference/api/csharp/aspire.hosting.postgresql.md)
- Type: [PostgresDatabaseResource](/reference/api/csharp/aspire.hosting.postgresql/postgresdatabaseresource.md)
- Kind: `Constructors`
- Members: `1`

A resource that represents a PostgreSQL database. This is a child resource of a [PostgresServerResource](/reference/api/csharp/aspire.hosting.postgresql/postgresserverresource.md).

## PostgresDatabaseResource(string, string, PostgresServerResource)

- Name: `Constructor(string, string, PostgresServerResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L21-L46)

A resource that represents a PostgreSQL database. This is a child resource of a [PostgresServerResource](/reference/api/csharp/aspire.hosting.postgresql/postgresserverresource.md).

```csharp
public class PostgresDatabaseResource
{
    public PostgresDatabaseResource(
        string name,
        string databaseName,
        PostgresServerResource postgresParentResource)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `databaseName` (`string`)
  The database name.
- `postgresParentResource` ([PostgresServerResource](/reference/api/csharp/aspire.hosting.postgresql/postgresserverresource.md))
  The PostgreSQL parent resource associated with this database.
