Skip to content

Commit 3e8f208

Browse files
StefanStefan
authored andcommitted
cli update
1 parent 212bfdd commit 3e8f208

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

articles/postgresql/flexible-server/connect-azure-cli.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This quickstart provides several ways to connect with Azure CLI wit
44
author: AlicjaKucharczyk
55
ms.author: alkuchar
66
ms.reviewer: maghan
7-
ms.date: 04/27/2024
7+
ms.date: 05/10/2024
88
ms.service: postgresql
99
ms.subservice: flexible-server
1010
ms.topic: quickstart
@@ -53,7 +53,7 @@ az postgres flexible-server connect \
5353
**Example:**
5454
```azurecli-interactive
5555
az postgres flexible-server connect \
56-
-n server372060240 -u dbuser -p "dbpassword" -d postgres
56+
-n server372060240 -u starchylapwing9 -p "dbpassword" -d postgres
5757
```
5858
You see similar output if the connection was successful.
5959

@@ -129,7 +129,7 @@ Closed the connection to server372060240
129129
```
130130

131131
## Run SQL File
132-
You can execute a sql file with the command using `--file-path` argument, `-f`.
132+
You can execute a sql file with the [az postgres flexible-server execute](/cli/azure/postgres/flexible-server#az-postgres-flexible-server-execute) command using `--file-path` argument, `-f`.
133133

134134
```azurecli-interactive
135135
az postgres flexible-server execute \
@@ -138,19 +138,29 @@ az postgres flexible-server execute \
138138
```
139139

140140
**Example:**
141+
Prepare a `test.sql` file. You can use the following test script with simple `SELECT` queries:
142+
143+
```sql
144+
SELECT 1;
145+
SELECT 2;
146+
SELECT 3;
147+
```
148+
149+
Save the content to the `test.sql` file in the current directory and execute using following command.
150+
151+
141152
```azurecli-interactive
142153
az postgres flexible-server execute \
143-
-n server372060240 -u dbuser -p "dbpassword" -d postgres \
144-
-f "./test.sql"
154+
-n server372060240 -u starchylapwing9 -p "dbpassword" -d postgres \
155+
-f "test.sql"
145156
```
146157

147158
You see an output as shown here:
148159

149160
```output
150-
Command group 'postgres flexible-server' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
151-
Running sql file '.\test.sql'...
161+
Running sql file 'test.sql'...
152162
Successfully executed the file.
153-
Closed the connection to server372060240.
163+
Closed the connection to server372060240
154164
```
155165

156166
## Next Steps

0 commit comments

Comments
 (0)