Skip to content

Commit b189e80

Browse files
author
stevestein
committed
remove version, fix conflict
2 parents 850715e + e26859d commit b189e80

16 files changed

Lines changed: 251 additions & 49 deletions
59.8 KB
Loading
105 KB
Loading
59.9 KB
Loading
79.5 KB
Loading
168 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: PostgreSQL extension (preview)
3+
titleSuffix: Azure Data Studio
4+
description: PostgreSQL extension (preview) for Azure Data Studio
5+
ms.custom: "seodec18"
6+
ms.date: "03/19/2019"
7+
ms.reviewer: "alayu; sstein"
8+
ms.prod: sql
9+
ms.technology: azure-data-studio
10+
ms.topic: conceptual
11+
author: "rachel-msft"
12+
ms.author: "raagyema"
13+
manager: craigg
14+
---
15+
16+
# PostgreSQL extension (preview)
17+
18+
The PostgreSQL extension (preview) enables you to connect to, query, and develop for Postgres using the capabilities of Azure Data Studio.
19+
20+
The Azure Data Studio functionality available for PostgreSQL includes:
21+
22+
- Connection manager & query editor
23+
- Customizable dashboards & insight widgets
24+
- Code snippets
25+
- [Integrated terminal](integrated-terminal.md)
26+
- [Keyboard shortcuts](keyboard-shortcuts.md)
27+
- [Source control integration](source-control.md)
28+
- [Workspace & user settings](settings.md)
29+
30+
31+
## Install the PostgreSQL extension (preview)
32+
33+
If you don't already have Azure Data Studio installed, see its [install instructions](download.md).
34+
35+
1. Select the extensions icon from the sidebar in Azure Data Studio.
36+
![Extensions icon](media/extensions/postgresql-extension/extensions-icon.png)
37+
38+
2. Type 'postgresql' into the search bar. Select the PostgreSQL extension.
39+
40+
3. Select **Install**. Once installed, select **Reload** to activate the extension in Azure Data Studio.
41+
42+
43+
## Next steps
44+
45+
Learn [how to connect and query Postgres from Azure Data Studio](quickstart-postgres.md).
46+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: "Quickstart: Connect and query PostgreSQL"
3+
titleSuffix: Azure Data Studio
4+
description: This quickstart shows how to use Azure Data Studio to connect to PostgreSQL and run a query
5+
ms.custom: "seodec18"
6+
ms.date: "03/19/2019"
7+
ms.prod: sql
8+
ms.technology: azure-data-studio
9+
ms.reviewer: "alayu; sstein"
10+
ms.topic: "quickstart"
11+
author: "rachel-msft"
12+
ms.author: "raagyema"
13+
manager: craigg
14+
---
15+
16+
# Quickstart: Connect and query PostgreSQL using [!INCLUDE[name-sos](../includes/name-sos-short.md)]
17+
This quickstart shows how to use [!INCLUDE[name-sos](../includes/name-sos-short.md)] to connect to Postgres, and then use SQL statements to create the database *tutorialdb* and query it.
18+
19+
## Prerequisites
20+
21+
To complete this quickstart, you need [!INCLUDE[name-sos](../includes/name-sos-short.md)], the PostgreSQL extension for [!INCLUDE[name-sos](../includes/name-sos-short.md), and access to a PostgreSQL server.
22+
23+
- [Install [!INCLUDE[name-sos](../includes/name-sos-short.md)]](download.md).
24+
- [Install the PostgreSQL extension for Azure Data Studio](postgres-extension.md).
25+
- [Install PostgreSQL](https://www.postgresql.org/download/). (Alternatively, you can create a Postgres database in the cloud using [az postgres up](https://docs.microsoft.com/azure/postgresql/quickstart-create-server-up-azure-cli)).
26+
27+
## Connect to PostgreSQL
28+
29+
1. Start **[!INCLUDE[name-sos](../includes/name-sos-short.md)]**.
30+
31+
2. The first time you start [!INCLUDE[name-sos](../includes/name-sos-short.md)] the **Connection** dialog opens. If the **Connection** dialog doesn't open, click the **New Connection** icon in the **SERVERS** page:
32+
33+
![New Connection Icon](media/quickstart-postgresql/new-connection-icon.png)
34+
35+
3. In the form that pops up, go to **Connection type** and select **PostgreSQL** from the drop-down.
36+
37+
38+
4. Fill in the remaining fields using the server name, user name, and password for your PostgreSQL server.
39+
40+
![New Connection Screen](media/quickstart-postgresql/new-connection-screen.png)
41+
42+
| Setting | Example value | Description |
43+
| ------------ | ------------------ | ------------------------------------------------- |
44+
| **Server name** | localhost | The fully qualified server name |
45+
| **User name** | postgres | The user name you want to log in with. |
46+
| **Password (SQL Login)** | *password* | The password for the account you are logging in with. |
47+
| **Password** | *Check* | Check this box if you don't want to enter the password each time you connect. |
48+
| **Database name** | \<Default\> | Fill this if you want the connection to specify a database. |
49+
| **Server group** | \<Default\> | This option lets you assign this connection to a specific server group you create. |
50+
| **Name (optional)** | *leave blank* | This option lets you specify a friendly name for your server. |
51+
52+
5. Select **Connect**.
53+
54+
After successfully connecting, your server opens in the **SERVERS** sidebar.
55+
56+
57+
## Create a database
58+
59+
The following steps create a database named **tutorialdb**:
60+
61+
1. Right-click on your PostgreSQL server in the **SERVERS** sidebar and select **New Query**.
62+
63+
2. Paste this SQL statement in the query editor that opens up.
64+
65+
```sql
66+
CREATE DATABASE tutorialdb;
67+
```
68+
69+
3. From the toolbar select **Run** to execute the query. Notifications appear in the **MESSAGES** pane to show query progress.
70+
71+
>[!TIP]
72+
> You can use **F5** on your keyboard to execute the statement instead of using **Run**.
73+
74+
After the query completes, right-click **Databases** and select **Refresh** to see **tutorialdb** in the list under the **Databases** node.
75+
76+
77+
## Create a table
78+
79+
The following steps create a table in the **tutorialdb**:
80+
81+
1. Change the connection context to **tutorialdb** using the drop-down in the query editor.
82+
83+
![Change context](media/quickstart-postgresql/change-context.png)
84+
85+
2. Paste the following SQL statement into the query editor and click **Run**.
86+
87+
> [!NOTE]
88+
> You can either append this or overwrite the existing query in the editor. Clicking **Run** executes only the query that is highlighted. If nothing is highlighted, clicking **Run** executes all queries in the editor.
89+
90+
```sql
91+
-- Drop the table if it already exists
92+
DROP TABLE IF EXISTS customers;
93+
-- Create a new table called 'customers'
94+
CREATE TABLE customers(
95+
customer_id SERIAL PRIMARY KEY,
96+
name VARCHAR (50) NOT NULL,
97+
location VARCHAR (50) NOT NULL,
98+
email VARCHAR (50) NOT NULL
99+
);
100+
```
101+
102+
## Insert rows
103+
104+
Paste the following snippet into the query window and click **Run**:
105+
106+
```sql
107+
-- Insert rows into table 'customers'
108+
INSERT INTO customers
109+
(customer_id, name, location, email)
110+
VALUES
111+
( 1, 'Orlando', 'Australia', ''),
112+
( 2, 'Keith', 'India', 'keith0@adventure-works.com'),
113+
( 3, 'Donna', 'Germany', 'donna0@adventure-works.com'),
114+
( 4, 'Janet', 'United States','janet1@adventure-works.com');
115+
```
116+
117+
## Query the data
118+
119+
1. Paste the following snippet into the query editor and click **Run**:
120+
121+
```sql
122+
-- Select rows from table 'customers'
123+
SELECT * FROM customers;
124+
```
125+
126+
2. The results of the query are displayed:
127+
128+
![View results](media/quickstart-postgresql/view-results.png)
129+
130+
## Next Steps
131+
132+
Learn about the [scenarios available for Postgres in Azure Data Studio](postgres-extension.md).

‎docs/relational-databases/security/contained-database-users-making-your-database-portable.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ ms.assetid: e57519bb-e7f4-459b-ba2f-fd42865ca91d
1414
author: VanMSFT
1515
ms.author: vanto
1616
manager: craigg
17-
monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
17+
monikerRange: "=azuresqldb-current||>=sql-server-2016||=azure-sqldw-latest||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
1818
---
1919
# Contained Database Users - Making Your Database Portable
2020

21-
[!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)]
21+
[!INCLUDE[appliesto-ss-asdb-asdw-xxx-md](../../includes/appliesto-ss-asdb-asdw-xxx-md.md)]
2222

2323
Use contained database users to authenticate [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] and [!INCLUDE[ssSDS](../../includes/sssds-md.md)] connections at the database level. A contained database is a database that is isolated from other databases and from the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]/ [!INCLUDE[ssSDS](../../includes/sssds-md.md)] (and the master database) that hosts the database. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] supports contained database users for both Windows and [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] authentication. When using [!INCLUDE[ssSDS](../../includes/sssds-md.md)], combine contained database users with database level firewall rules. This topic reviews the differences and benefits of using the contained database model compared to traditional login/user model and Windows or server-level firewall rules. Specific scenarios, manageability or application business logic may still require use of traditional login/user model and server-level firewall rules.
2424

‎docs/relational-databases/system-catalog-views/sys-databases-transact-sql.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If a database is not `ONLINE`, or `AUTO_CLOSE` is set to `ON` and the database i
111111
|**is_temporal_retention_enabled**|**bit**|Indicates whether temporal retention policy cleanup task is enabled.<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
112112
|**catalog_collation_type**|**int**|The catalog collation setting:<br />0 = DATABASE_DEFAULT<br />2 = SQL_Latin_1_General_CP1_CI_AS<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
113113
|**catalog_collation_type_desc**|**nvarchar(60)**|The catalog collation setting:<br />DATABASE_DEFAULT<br />SQL_Latin_1_General_CP1_CI_AS<br /> **Applies to**: [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)]|
114+
|**Is_result_set_caching**|**int**|Reserved for internal use</br>**Applies to**: Azure SQL Data Warehouse
114115

115116
## Permissions
116117
If the caller of `sys.databases` is not the owner of the database and the database is not `master` or `tempdb`, the minimum permissions required to see the corresponding row are `ALTER ANY DATABASE` or the `VIEW ANY DATABASE` server-level permission, or `CREATE DATABASE` permission in the `master` database. The database to which the caller is connected can always be viewed in `sys.databases`.

‎docs/relational-databases/system-catalog-views/sys-security-policies-transact-sql.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ ms.assetid: 35362f5b-e601-4049-9e1d-c5307e823831
2121
author: VanMSFT
2222
ms.author: vanto
2323
manager: craigg
24-
monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
24+
monikerRange: "=azuresqldb-current||>=sql-server-2016||=azure-sqldw-latest||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
2525
---
2626
# sys.security_policies (Transact-SQL)
27-
[!INCLUDE[tsql-appliesto-ss2016-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2016-asdb-xxxx-xxx-md.md)]
27+
[!INCLUDE[tsql-appliesto-ss2016-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2016-asdb-asdw-xxx-md.md)]
2828

2929
Returns a row for each security policy in the database.
3030

0 commit comments

Comments
 (0)