- mac OS packages
- Interactive installer by EDB
- Platform support
- Postgres.app
- Homebrew
- MacPorts
- PostgreSQL Setup : Mac Edition
- Reduce your efforts on PostgreSQL installation and issues in Mac OS with these 4 steps
- Step 1 : Getting Homebrew
- Step 2: Installing PostgreSQL
- Step 3: Initialize Database
- Step 4.1: Connect to database via command line
- 17 Practical psql Commands That You Don’t Want To Miss
- Summary: in this tutorial, we give you a list of common psql commands that helps you query data from PostgreSQL…
- Step 4.2: Connect to database via Popular GUIs
- Recommended GUIs
- 1. Postico
- 2. pgAdmin
- 3. DataGrip
- Postgres.app
- The easiest way to get started with PostgreSQL on the Mac
- Installing Postgres.app
- Graphical Clients
- How to connect
- Django
- Flask
- SQLAlchemy
- Rails
- Sinatra
- ActiveRecord
- DataMapper
- Sequel
- Support
- Установка и подключение PostgreSQL на Mac Os
- Установка PostgreSQL на Mac Os
- Не обязательно
- Подключение к PostgreSQL на Mac OS
- Как подключиться к PostgreSQL на Mac OS
- Подключение в сторонней программе к БД
- DataGrip
- Исправление ошибок
- Читайте также
- pgAdmin
- PostgreSQL Tools
- Quick Links
- Latest Videos
- 2021-10-07 — pgAdmin 4 v6.0 Released
- 2021-09-09 — pgAdmin 4 v5.7 Released
- 2021-08-12 — pgAdmin 4 v5.6 Released
- 2021-07-15 — pgAdmin 4 v5.5 Released
- 2019-11-21 — Try pgAdmin online!
- 2018-07-12 — pgAgent v4.0.0 Released
mac OS packages 
You can get macOS PostgreSQL packages from several different sources.
Interactive installer by EDB
Download the installer certified by EDB for all supported PostgreSQL versions.
This installer includes the PostgreSQL server, pgAdmin; a graphical tool for managing and developing your databases, and StackBuilder; a package manager that can be used to download and install additional PostgreSQL tools and drivers. Stackbuilder includes management, integration, migration, replication, geospatial, connectors and other tools.
This installer can run in graphical, command line, or silent install modes.
The installer is designed to be a straightforward, fast way to get up and running with PostgreSQL on macOS.
Advanced users can also download a zip archive of the binaries, without the installer. This download is intended for users who wish to include PostgreSQL as part of another application installer.
Platform support
The installers are tested by EDB on the following platforms. They will generally work on newer versions of macOS as well:
PostgreSQL Version | 64-bit macOS Platforms |
---|---|
13 | 10.14 — 11.0 |
12 | 10.13 — 10.15 |
11 | 10.12 — 10.14 |
10 | 10.11 — 10.13 |
9.6 | 10.10 — 10.12 |
Postgres.app
Postgres.app is a simple, native macOS app that runs in the menubar without the need of an installer. Open the app, and you have a PostgreSQL server ready and awaiting new connections. Close the app, and the server shuts down.
Homebrew
PostgreSQL can also be installed on macOS using Homebrew. Please see the Homebrew documentation for information on how to install packages.
A list of PostgreSQL packages can be found using the Braumeister search tool.
MacPorts
PostgreSQL packages are also available for macOS from the MacPorts Project. Please see the MacPorts documentation for information on how to install ports.
A list of PostgreSQL packages can be found using the portfiles search tool on the MacPorts website.
PostgreSQL packages are available for macOS from the Fink Project. Please see the Fink documentation for information on how to install packages.
A list of PostgreSQL packages can be found using the package search tool on the Fink website.
Copyright © 1996-2021 The PostgreSQL Global Development Group
Источник
PostgreSQL Setup : Mac Edition
Reduce your efforts on PostgreSQL installation and issues in Mac OS with these 4 steps
PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and technical standards compliance. It is designed to handle a range of workloads, from single machines to data warehouses or Web services with many concurrent users.
If you already have Homebrew installed, you can skip to Installing PostgreSQL. Otherwise, let’s keep going.
Step 1 : Getting Homebrew
To install PostgreSQL on the command line we will be using a package manager called Homebrew. In MacOSX 10.7 or higher, the Ruby interpreter comes pre-installed. Let’s start by copying and pasting the following command into our command line:
Step 2: Installing PostgreSQL
The first thing we’re going to do is install Postgres. There are two main ways to get Postgres onto your machine:
- Using a graphical installer like BigSQL or Postgres.app (Requires macOS 10.12 for latest)
- Using a package manager to install via the command line.
You can pick whichever option is right for you. For this tutorial, let’s see how to install on the command line.
How to check if PostgreSQL is installed in you mac?
Remove previous versions of PostgreSQL
Delete all Files of Postgres
Install Postgres with Homebrew
Start PostgreSQL server
To have launchd start postgresql now and restart at login:
Or, if you don’t want/need a background service you can just run:
Step 3: Initialize Database
If terminal shows an error like below:
Remove old database file
rm -r /usr/local/var/postgres
Run the initdb command again
Step 4.1: Connect to database via command line
Postgres works pretty hard to make itself usable right out of the box without you having to do anything. By default, it automatically creates the user postgres . Let’s see what other users it has created. Let’s start by using the psql utility, which is a utility installed with Postgres that lets you carry out administrative functions without needing to know their actual SQL commands.
Start by entering the following on the command line:
(You may need to use sudo psql postgres for this command to work, depending on how your system is configured).
17 Practical psql Commands That You Don’t Want To Miss
Summary: in this tutorial, we give you a list of common psql commands that helps you query data from PostgreSQL…
Step 4.2: Connect to database via Popular GUIs
There are many clients for PostgreSQL on the Mac. You can find many of them in the Community Guide to PostgreSQL GUI Tools in the PostgreSQL wiki. Some of them are quite powerful; some are still a bit rough. Here’s a list of all the Mac Apps I found (in alphabetic order):
Recommended GUIs
1. Postico
Postico is a modern Postgres client for OSX, built by the same developer who built Postgres.app (mentioned above). It is free, but you can buy a license to unlock additional power features. This is the GUI that I use to manage Postgres because it is built specifically for Mac and has a beautiful, very easy to use (but powerful) UI. It also includes an SQL editor for complex queries.
2. pgAdmin
pgAdmin is the oldest of the Postgres GUIs, its first version being released just a few months after Postgre’s first release in 1996. Having been rewritten several times, it can run on Linux, MacOSX, and Windows, and features powerful database management tools including a syntax-highlighted SQL editor. Designed to run on both client machines and on deployed servers, pgAdmin is capable of handling advanced cases that Postico cannot. It’s dashboard is one of it’s kind and is an absolute essential tool when using Postgres in a distributed microservice architecture.
3. DataGrip
DataGrip is my favorite when it comes to IDEs. It is a modern IDE developed by JetBrains that offers efficient schema navigation, an intelligent query console, and version control integration. DataGrip also resolves references in your SQL code and helps you refactor them.
Источник
Postgres.app
The easiest way to get started with PostgreSQL on the Mac
Postgres.app is a full-featured PostgreSQL installation packaged as a standard Mac app. It includes everything you need to get started, and we’ve even included the popular extension PostGIS for geo data.
Postgres.app has a beautiful user interface and a convenient menu bar item. You never need to touch the command line to use it – but of course we do include all the necessary command line tools and header files for advanced users.
Postgres.app can install minor updates automatically, so you get bugfixes as soon as possible.
Installing Postgres.app
Download ➜ Move to Applications folder ➜ Double Click
If you don’t move Postgres.app to the Applications folder, you will see a warning about an unidentified developer and won’t be able to open it.
Click «Initialize» to create a new server
Configure your $PATH to use the included command line tools (optional):
Done! You now have a PostgreSQL server running on your Mac with these default settings:
Host | localhost |
Port | 5432 |
User | your system user name |
Database | same as user |
Password | none |
Connection URL | postgresql://localhost |
To connect with psql, double click a database. To connect directly from the command line, type psql . If you’d rather use a graphical client, see below.
NOTE: These instructions assume that you’ve never installed PostgreSQL on your Mac before. If you have previously installed PostgreSQL using homebrew, MacPorts, the EnterpriseDB installer, consider removing other PostgreSQL installations first. We also have instructions for upgrading from older versions of Postgres.app.
Graphical Clients
Postgres.app includes psql , a versatile command line client for PostgreSQL. But it’s not the only option; there are plenty of great graphical clients available for PostgreSQL. Two popular tools are:
pgAdmin 4 is a feature rich open source PostgreSQL client. It has support for almost every feature in PostgreSQL. The only downside is that the cross-plattform UI really doesn’t live up to the expectations of a native Mac app.
Postico on the other hand, is a very modern Mac app. It’s made by the same people that maintain Postgres.app, and we think you’ll like it! We put a lot of effort into making it a joy to use. However, it doesn’t have the extensive feature set of pgAdmin, and it’s a commercial app rather than open source.
Aside from those two options, there are a lot more to choose from! Check the documentation for a list of amazing Mac apps for PostgreSQL.
How to connect
After your PostgreSQL server is up and running, you’ll probably want to connect to it from your application. Here’s how to connect to PostgreSQL from popular programming languages and frameworks:
To connect from PHP, make sure that it supports PostgreSQL. The version included with macOS doesn’t support PostgreSQL. We recommend MAMP for an easy way to install a current version of PHP that works.
You can use PDO (object oriented):
Or the pg_connect() functions (procedural):
To connect to a PostgreSQL server with Python, please first install the psycopg2 library:
Django
In your settings.py, add an entry to your DATABASES setting:
Flask
When using the Flask-SQLAlchemy extension you can add to your application code:
SQLAlchemy
To install the pg gem, make sure you have set up your $PATH correctly (see Command-Line Tools), then execute the following command:
Rails
In config/database.yml, use the following settings:
Sinatra
In config.ru or your application code:
ActiveRecord
Install the activerecord gem and require ‘active_record’, and establish a database connection:
DataMapper
Install and require the datamapper and do_postgres gems, and create a database connection:
Sequel
Install and require the sequel gem, and create a database connection:
Java
- Download and install the PostgreSQL JDBC driver
- Connect to the JDBC URL jdbc:postgresql://localhost
For more information see the official PostgreSQL JDBC documentation.
libpq is the native C client library for connecting to PostgreSQL. It’s really easy to use:
Now compile the file with clang and run it:
You can just use the C API in Swift! First include libpq in your bridging header:
Then make sure to link with libpq.
On iOS, you’ll need to build libpq yourself.
On macOS you can use the system provided libpq (does not support SSL) or use libpq provided by Postgres.app by adding the following build settings:
Other Linker Flags | -lpq |
---|---|
Header Search Paths | /Applications/Postgres.app/Contents/Versions/latest/include |
Library Search Paths | /Applications/Postgres.app/Contents/Versions/latest/lib |
Now you can use the libpq C library to connect to PostgreSQL:
Support
We have a list of common problems in the troubleshooting section in the documentation.
For general questions concerning PostgreSQL, have a look at the official PostgreSQL documentation.
Источник
Установка и подключение PostgreSQL на Mac Os
Устанавливаем PostgreSQL на Mac OS.
Установка PostgreSQL на Mac Os
Добавляем в автозапуск при старте системы Mac OS.
Также можно запустить вручную:
Не обязательно
Если автозагрузка не сработает. Можно провести такие манипуляции:
Директория автозагрузки находится здесь:
Добавляем в автозагрузку
Подключение к PostgreSQL на Mac OS
Подключение на Mac OS немного отличается от Linux. Проверим пользователей:
Для подключения указываем Owner из таблицы выше:
Как создать БД и пользователя, следовать инструкции:
https://ploshadka.net/postgresql/
Если коротко, то для локалки достаточно ввести в консоль:
Как подключиться к PostgreSQL на Mac OS
На localhost достаточно создать базу данных и подключиться к ней указав только её имя:
Остальное подхватиться по умолчанию.
Подключение в сторонней программе к БД
DataGrip
На примере программы DataGrip:
Исправление ошибок
Статья по исправлению некоторых ошибок с правами доступа.
Читайте также
Кстати, на сайте нет рекламы. У сайта нет цели самоокупаться, но если вам пригодилась информация можете задонатить мне на чашечку кофе в макдаке. Лайкнуть страницу или просто поблагодарить. Карма вам зачтется.
Источник
pgAdmin
PostgreSQL Tools
pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
pgAdmin may be used on Linux, Unix, macOS and Windows to manage PostgreSQL and EDB Advanced Server 9.5 and above.
Quick Links
Latest Videos
Want to see your pgAdmin video here? Email webmaster@pgadmin.org.
2021-10-07 — pgAdmin 4 v6.0 Released
The pgAdmin Development Team are pleased to announce pgAdmin 4 version 6.0. This release of pgAdmin 4 includes 18 bug fixes and new features. For more details please see the release notes.
Notable changes in this release include:
Introduction to ReactJS framework in pgAdmin 4:
ReactJS has a strong developer community and popularity. It has grown to a level where its performance is comparable to that of desktop applications. Migrating pgAdmin to use ReactJS has proven to boost pgAdmin’s performance and user experience.
In this release we have ported the browser Tree, all the object dialogs, and the Grant Wizard.
Features:
- Added support for OWNED BY Clause for sequences.
This feature adds the OWNED BY clause for the sequences. The OWNED BY option causes the sequence to be associated with a specific table column, such that if that column (or its whole table) is dropped, the sequence will be automatically dropped as well.
Bugs/Housekeeping:
- Port object nodes and properties dialogs to React.
- Port browser tree to React.
- Port Grant Wizard to react.
- Remove GPDB support completely.
- Added support to create the Partitioned table using COLLATE and opclass.
- Fixed keyerror issue in schema diff for ‘attnum’ and ‘edit_types’ parameter.
- Fixed an issue where the Execute button of the query tool gets disabled once we change anything in the data grid.
- Ensure that SQL help should work for EPAS servers.
- Fixed an issue where the grant wizard is unresponsive if the database size is huge.
Note: The publication of the python package to PyPi has been delayed and will be completed as soon as possible.
2021-09-09 — pgAdmin 4 v5.7 Released
The pgAdmin Development Team are pleased to announce pgAdmin 4 version 5.7. This release of pgAdmin 4 includes 26 bug fixes and new features. For more details please see the release notes.
Notable changes in this release include:
Features:
- Added support for the truncate table with restart identity.
- Added database and server information on the Maintenance process watcher dialog..
- Allow the referenced table to be the same as the local table in one to many relationship for ERD Tool..
- Make closing tabs to be smarter by focusing on the appropriate tab when the user closed a tab..
- Set PSQLRC and PSQL_HISTORY env vars to apt. user storage path in the server mode..
Bugs/Housekeeping:
- Fixed blank screen issue on windows and also made changes to use NWjs manifest for remembering window size.
- Ensure that trigger function SQL should have ‘create or replace function’ instead of ‘create function’ only.
- Fixed the export image issue where relation lines are over the nodes.
- Fixed width limitation issue in PSQL tool window.
- Fixed an issue where columns with sequences get altered unnecessarily with a schema diff tool.
- Ensure that the lock panel should not be blocked for larger records.
- Fixed an issue where whitespace in function bodies was not applied while generating the script using Schema Diff.
- Introduced the OAUTH2_SCOPE variable for the Oauth2 scope configuration.
- Enables pgAdmin to retrieve user permissions in case of nested roles, which helps to terminate the session for AWS RDS.
- Ensure that pgAdmin should not fail at login due to a special character in the hostname.
2021-08-12 — pgAdmin 4 v5.6 Released
The pgAdmin Development Team are pleased to announce pgAdmin 4 version 5.6. This release of pgAdmin 4 includes 14 bug fixes and new features. For more details please see the release notes.
Notable changes in this release include:
Features:
- Added support to copy SQL from main window to query tool.
This feature is used to copy the SQL script for the selected browser tree node in the query tool. For this we have added new preferences setting ‘Copy SQL from main window to query tool?’
Added support for formatted JSON viewer/editor when interacting with data in a JSON column.
This feature allows the user to format, view and edit JSON data in a very nice way. JSON editors have so many formats to view data differently.
Bugs/Housekeeping:
- Rename the «Resize by data?» to «Columns sized by» and disabled the ‘Maximum column width’ button if ‘Columns sized by’ is set to ‘Column data’.
- Ensure that the login account should be locked after N number of attempts. N is configurable using the ‘MAX_LOGIN_ATTEMPTS’ parameter.
- Fixed CSRF errors for stale sessions by increasing the session expiration time for desktop mode.
- Fixed an issue in the search object when searching in ‘all types’ or ‘subscription’ if the user doesn’t have access to the subscription.
- Fixed an issue where paste was not working through the Right-Click option on PSQL.
- Fixed TypeError ‘NoneType’ object is not sub scriptable.
- Fixed an issue where the titles in query tabs are different.
- Fixed dashboard server activity issue when active_since parameter is None.
2021-07-15 — pgAdmin 4 v5.5 Released
The pgAdmin Development Team are pleased to announce pgAdmin 4 version 5.5. This release of pgAdmin 4 includes 18 bug fixes and new features. For more details please see the release notes.
Notable changes in this release include:
Features:
- Highlighted long running queries on the dashboards
This feature is implemented to highlight the long running queries. It allows the user to provide the warning and alert threshold values in minutes. Depending on the threshold value pgAdmin4 highlights the long running queries on the Dashboard.
Added support for Reassign/Drop Owned for login roles.
This feature allows the user to change the ownership of database objects owned by a database role or remove database objects owned by a database role.
Added support for OAuth 2 authentication
This feature allows the user to connect to the pgAdmin 4 server using OAuth2 authentication. To enable OAUTH2 authentication for pgAdmin, you must configure the OAUTH2 settings in the config_local.py or config_system.py file.
Bugs/Housekeeping:
- Ensure that the Data Output panel can be snapped back after it is detached.
- Fixed replace keyboard shortcut issue in the query tool on the normal keyboard layout.
- Remove leading whitespace and replace it with ‘[. ] ‘ in the Query Tool data grid so cells don’t look empty.
- Fixed an issue in the search object when searching in ‘all types’ or ‘subscription’ if the user doesn’t have access to the subscription.
- Fixed an issue where the New Connection Drop Down has lost default maintenance database, auto-select, and tab-through functionality..
- Ensure that setting ‘Open in new browser tab’ should be visible, it should not be based on the value of ‘ENABLE_PSQL’.
- Disable email deliverability check that was introduced in flask-security-too by default to maintain backwards compatibility.
- Fixed an issue where incorrect column names were listed in the properties of Index.
2019-11-21 — Try pgAdmin online!
Our friends at EnterpriseDB have kindly made an online demo environment for pgAdmin available to allow new users to try it out in their browser without needing to download or install any software. The environment (based on the Katacoda learning platform) includes pgAdmin and PostgreSQL 12, preloaded with the pagila sample database, and is unique to every user allowing a far better experience than typical shared demo environments.
2018-07-12 — pgAgent v4.0.0 Released
The pgAdmin Development Team are pleased to announce the release of pgAgent v4.0.0.
pgAgent is a job scheduler for PostgreSQL; for more information please see the documentation included as part of the pgAdmin documentation at https://www.pgadmin.org/docs/pgadmin4/3.x/pgagent.html.
We expect DEB and RPM packages to be available from the PostgreSQL APT/YUM repositories in due course, as well as an updated installer from EnterpriseDB available through StackBuilder.
Notable changes in this release include:
- Remove the dependency on wxWidgets. pgAgent now uses Boost for thread management and synchronisation [Neel Patel]
- Refactor connection parsing logic to fix issues with and improve handling of connection strings [Thomas Krennwallner]
- Handle 2 digit server version numbers [Ashesh Vashi]
- Fix handling of the «succeeded» flag on job steps which could prevent failure of steps causing the following steps to fail [Sanket Mehta]
Источник