Remove-PostgreSQL Cmdlet
Deletes PostgreSQL data.
Syntax
Remove-PostgreSQL [parameters]
Remarks
The Remove-PostgreSQL cmdlet allows you to use a syntax similar to SQL DELETE statements to delete PostgreSQL data.
$conn = Connect-PostgreSQL -User 'postgres' -Password 'admin' -Server '127.0.0.1' -Port '5432' -Database 'postgres' Remove-PostgreSQL -Connection $conn -Table "`"postgres`".`"schema01`".Orders" -Id "10261"The Where parameter can also be used to specify the primary key:
Remove-PostgreSQL -Connection $conn -Table "exTablePowershell;" -Where "Id = 10261"The primary key can also be passed to the cmdlet along the pipeline:
Select-PostgreSQL -Connection $conn -Table "postgres"."schema01".Orders -Where "ShipCountry = 'USA'" | Remove-PostgreSQL