--- title: "Get-VEPSQLDatabase" description: "Returns backed-up PostgreSQL databases. Product: Veeam Backup & Replication Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License This cmdlet returns an array of PostgreSQL databases." canonical: "https://helpcenter.veeam.com/docs/vbr/explorers_powershell/get-vepsqldatabase.html" breadcrumb: "Veeam Explorers PowerShell Reference > Veeam Explorers PowerShell Reference > Veeam Explorer for PostgreSQL > Get-VEPSQLDatabase" dateModified: "2026-08-18" --- # Get-VEPSQLDatabase ## Short Description Returns backed-up PostgreSQL databases. **Product**: Veeam Backup & Replication **Product Edition**: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` Get-VEPSQLDatabase [-Session] [[-Name] ] [[-InstanceName] ] [] ``` ## Detailed Description This cmdlet returns an array of PostgreSQL databases. After you get the backed-up PostgreSQL databases, you can use the [`Start-VEPSQLDatabaseExport`](start-vepsqldatabaseexport.md) cmdlet to export the necessary databases. ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

InstanceName

Specifies an array of names of PostgreSQL instances. The cmdlet will return an array of databases located on the specified instances.

String[]

False

2

False

Name

Specifies an array of names of PostgreSQL databases. The cmdlet will return an array of databases with the specified names.

String[]

False

1

False

Session

Specifies an active restore session. The cmdlet will return an array of databases within the specified restore session.

Accepts the VEPSQLRestoreSession object. To get this object, run the Get-VEPSQLRestoreSession cmdlet.

VEPSQLRestoreSession

True

0

True (ByValue)

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the [About Common Parameters](http://go.microsoft.com/fwlink/p/?LinkID=113216) section of Microsoft Docs. ## Output Object The cmdlet returns the [`VEPSQLDatabase`](vepsqldatabase.md)`[]` array that contains backed-up PostgreSQL databases. ## Examples ::: example ### Example 1. Getting All PostgreSQL Databases Within Specified Restore Session This example shows how to get an array of all PostgreSQL databases within the specified restore session. ``` $session = Get-VEPSQLRestoreSession $database = Get-VEPSQLDatabase -Session $session[1] ``` Perform the following steps: 1. Run the [`Get-VEPSQLRestoreSession`](get-vepsqlrestoresession.md) cmdlet. Save the result to the `$session` variable. The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session (in this example, it is the second restore session in the array). 2. Run the `Get-VEPSQLDatabase` cmdlet. Set the `$session` variable as the `Session` parameter value and select the necessary restore session. Save the result to the `$database` variable to be able to use it with other cmdlets. ::: ::: example ### Example 2. Getting PostgreSQL Databases with Specified Names This example shows how to get an array of PostgreSQL databases with the specified names. ``` $session = Get-VEPSQLRestoreSession $dbnames = @("fiscal", "sales", "IT") $database = Get-VEPSQLDatabase -Session $session[0] -Name $dbnames ``` Perform the following steps: 1. Run the [`Get-VEPSQLRestoreSession`](get-vepsqlrestoresession.md) cmdlet. Save the result to the `$session` variable. The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array. 2. Declare the `$dbnames` variable. Assign to this variable an array with the names of the necessary PostgreSQL databases. 3. Run the `Get-VEPSQLDatabase` cmdlet. Set the `$session` variable as the `Session` parameter value and specify the necessary restore session. Set the `$dbnames` variable as the `Name` parameter value. Save the result to the `$database` variable to be able to use it with other cmdlets. ::: ::: example ### Example 3. Getting All PostgreSQL Databases on Specified Instances This example shows how to get all PostgreSQL databases on specific instances. ``` $session = Get-VEPSQLRestoreSession $instancenames = @("rhel01:5433", "rhel01:5434") $database = Get-VEPSQLDatabase -Session $session[0] -InstanceName @instancenames ``` Perform the following steps: 1. Run the [`Get-VEPSQLRestoreSession`](get-vepsqlrestoresession.md) cmdlet. Save the result to the `$session` variable. The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In this example, it is the first restore session in the array. 2. Declare the `$instancenames` variable. Assign to this variable an array with the names of the necessary PostgreSQL instances. 3. Run the `Get-VEPSQLDatabase` cmdlet. Set the `$session` variable as the `Session` parameter value and specify the necessary restore session. Set the `$instancenames` variable as the `InstanceName` parameter value. Save the result to the `$database` variable to be able to use it with other cmdlets. ::: ## Related Commands [`Get-VEPSQLRestoreSession`](get-vepsqlrestoresession.md)