# PostgresDatabaseResource Properties

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

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

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L35-L40)

Gets the connection string expression for the Postgres database.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## DatabaseName

- Name: `DatabaseName`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L46)

Gets the database name.

```csharp
public string DatabaseName { get; }
```

## JdbcConnectionString

- Name: `JdbcConnectionString`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L69)

Gets the JDBC connection string for the PostgreSQL database.

```csharp
public ReferenceExpression JdbcConnectionString { get; }
```

## Remarks

Format: `jdbc:postgresql://{host}:{port}/{database}`.

User and password credentials are not included in the JDBC connection string. Use the `IResourceWithConnectionString.GetConnectionProperties` method to access the `Username` and `Password` properties.

## Parent

- Name: `Parent`
- Modifiers: `get`
- Returns: [PostgresServerResource](/reference/api/csharp/aspire.hosting.postgresql/postgresserverresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L26)

Gets the parent PostgresSQL container resource.

```csharp
public PostgresServerResource Parent { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs#L60)

Gets the connection URI expression for the PostgreSQL database.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `postgresql://{user}:{password}@{host}:{port}/{database}`.
