# PostgresServerResource Constructors

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

A resource that represents a PostgreSQL container.

## PostgresServerResource(string, ParameterResource?, ParameterResource)

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

Initializes a new instance of the [PostgresServerResource](/reference/api/csharp/aspire.hosting.postgresql/postgresserverresource.md) class.

```csharp
public class PostgresServerResource
{
    public PostgresServerResource(
        string name,
        ParameterResource? userName,
        ParameterResource password)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `userName` (`ParameterResource?`)
  A parameter that contains the PostgreSQL server user name, or `null` to use a default value.
- `password` (`ParameterResource`)
  A parameter that contains the PostgreSQL server password.
