kandi background
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
Explore all Server open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Server

electron v19.0.0-alpha.4

2022-04-19, Version 18.0.0 (Current), @BethGriggs

v1.20.6

v14.0.0-next.14

TypeScript 4.7 Beta

electron

electron v19.0.0-alpha.4

node

2022-04-19, Version 18.0.0 (Current), @BethGriggs

deno

v1.20.6

angular

v14.0.0-next.14

TypeScript

TypeScript 4.7 Beta

Popular Libraries in Server

Trending New libraries in Server

Top Authors in Server

1

226 Libraries

2892

2

219 Libraries

4063

3

184 Libraries

36300

4

157 Libraries

123166

5

129 Libraries

3091

6

113 Libraries

177734

7

101 Libraries

6817

8

94 Libraries

31056

9

86 Libraries

5284

10

82 Libraries

7166

1

226 Libraries

2892

2

219 Libraries

4063

3

184 Libraries

36300

4

157 Libraries

123166

5

129 Libraries

3091

6

113 Libraries

177734

7

101 Libraries

6817

8

94 Libraries

31056

9

86 Libraries

5284

10

82 Libraries

7166

Trending Kits in Server

javascript-node-js-payment-processing

15 best Node.js Payment

<img src="https://kandi.dev/owassets/javaScript-nodejs-payment-processing-libraries-banner.webp" alt="JavaScript Nodejs Payment Processing Libraries Banner" style="height:auto;max-width:100%;"/> Node.js is a flexible and lightweight platform that allows developers to build fast and scalable applications that work brilliantly in real-time. Its event-driven, non-blocking I/O model makes it highly efficient for data-intensive applications that need to run across multiple devices. Ecommerce applications often run on Node payment processing software components. These components work towards ensuring the integration of payment gateways, thereby enabling multiple payment options and risk-free authentication. Some of these payment processing platforms may include PayPal, Apple Pay, Google Pay, UnionPay, and similar applications. JavaScript’s dynamic and flexible environment ensures that every payment system runs smoothly and efficiently in real-time. Here are our picks of the 15 best JavaScript Node.js payment processing libraries that are open source in 2022. expressCart - fully functioning Node.js shopping cart; stripe-node - Node.js library for the Stripe API; stripe-billing-typographic - Typographic is a complete, full-stack example of a Stripe Billing integration.

nft-marketplace-for-images

NFT Marketplace for Images

<img src="https://kandi.dev/owassets/nft-marketplace-images-banner.png" alt="NFT Marketplace for Images Banner" style="height:auto;max-width:100%;"/> NFT's or Non Fungible Token's are a new technology phenomenon allowing clear ownership and easy transferability of digital art. This property means each token is unique and cannot be swapped identically for another token ever. NFT can be most anything digital, such as art, images, videos, music, memes, and tweets. The process of creating NFTs is “minting”, similar in concept to metal coins that are minted (stamped) to confirm their legitimacy. Minting an NFT produces a one-of-a-kind token on the blockchain and an electronic certificate of authenticity. NFT Marketplace for Images is used to generate the cryptoboy using the NFT, Blockchain, Cryptocurrency. The generated cryptoboy can be sold and they can see who is the token owner and also token metadata. <button class="MuiButtonBase-root MuiButton-root MuiButton-contained editexp MuiButton-containedSecondary click_collections_oneclickfiledownload " onclick="location.href='https://github.com/kandikits/cryptoboys-nft-marketplace/raw/main/Kit_installer.zip'" type="button"> ⬇️ Download 1-Click Installer </button> <img src="https://nftcalendar.io/storage/uploads/events/2022/1/WjVWzwRUHNbRCZxbCUyes22S8IXppiMlRpZXm9Y2.gif" width="500" height="500" > <h3>Features:</h3> 1)Mint custom ERC721 implemented Crypto Boy Tokens. 2)Sell Crypto Boy tokens on the marketplace. 3)Set desired token price. 4)Toggle between keeping the token for sale and not for sale. 5)Keeps track of all the tokens owned by an account - minted and bought. 6)Query blockchain for the token owner and token metadata. 7)User can mint a token only after every 5 minutes. <img src="https://raw.githubusercontent.com/devpavan04/cryptoboys-nft-marketplace/main/image.png" width="500" height="500"> <b>Scope:</b> NFTs used in cryptoboy are digitally unique, no two NFTs are the same. Every NFT used in cryptoboy must have an owner and this is of public record and easy for anyone to verify. <h3>Technological Innovation:</h3> <b>1.NFT:</b> NFTs are unique cryptographic tokens that exist on a blockchain and they cannot be replaced or copied/paste a new NFT into existence it is recorded in a blockchain. And that is used to certify authenticity and ownership as a digital asset. It’s generally built using the same kind of programming as cryptocurrency, like Bitcoin or Ethereum, but that’s where the similarity ends. <b>2.Blockchain:</b> Blockchain is a system it is used to record information in a way it makes difficult or impossible to change, hack, or cheat the system. A blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. The primary use of blockchains is as a distributed ledger for cryptocurrencies such as bitcoin. <b>3.Cryptocurrencies:</b> Mostly cryptocurrencies use blockchain technology to record transactions, in which transactions are verified and records maintained by a decentralized system using cryptography, rather than by a centralized authority. <h3> Browser Extension</h3> <b>Metamask:</b> MetaMask-extension library is a software cryptocurrency wallet used to interact with the Ethereum blockchain. It allow users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications. <h3>Stack</h3> <b>Solidity</b> - Object-oriented, high-level language for implementing smart contracts. <b>Bootstrap 4</b> - CSS framework for faster and easier web development. <b>React.js</b> - JavaScript library for building user interfaces. <b>web3.js</b> - Allow users to interact with a local or remote ethereum node using HTTP, IPC or WebSocket. <b>Truffle</b> - Development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM). <b>Ganache</b> - Personal blockchain for Ethereum development used to deploy contracts, develop DApps, and run tests. <h3>Troubleshooting:</h3> 1. While running batch file, if you encounter Windows protection alert, select More info --> Run anyway. 2. During kit installer, if you encounter a Windows security alert, click Allow. 3. Ensure Ganache is open before running the 1-Click Installer. 4. Make sure you have chosen the Ganache Network in the Metamask Extension. 5. Sometimes you may face the "out of gas error" to resolve this error, edit the "Gas Limit". 6 .Sometimes after npm start it throw's an error as create the .env file. For that create the .env file inside the project SKIP_PREFLIGHT_CHECK=true .

kandi

1-Click Install

akshara-kit2

Python Libraries for Applications

Python is known for its general-purpose nature which makes it applicable in almost every domain of software development. Python makes its presence in every emerging field. It provides very high-level dynamic data types and supports dynamic type checking. It is the fastest-growing programming language and can develop any application. It was created by Guido van Rossum during 1985 - 1990. It supports functional and structured programming methods as well as OOP. It can be used as a scripting language or can be compiled to byte-code. <center><img src="http://drive.google.com/uc?export=view&id=1RojXcakMc7P1GNkZXzH4bB63t4Y-cVGp" width="305" height="265" ></center> <b>Advantages of Python : </b> <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Interpreted <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Interactive <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Object-Oriented <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is a Beginner's Language

nft-marketplace-for-images

NFT Marketplace for Images

<img src="https://kandi.dev/owassets/nft-marketplace-images-banner.png" alt="NFT Marketplace for Images Banner" style="height:auto;max-width:100%;"/> NFT's or Non Fungible Token's are a new technology phenomenon allowing clear ownership and easy transferability of digital art. This property means each token is unique and cannot be swapped identically for another token ever. NFT can be most anything digital, such as art, images, videos, music, memes, and tweets. The process of creating NFTs is “minting”, similar in concept to metal coins that are minted (stamped) to confirm their legitimacy. Minting an NFT produces a one-of-a-kind token on the blockchain and an electronic certificate of authenticity. NFT Marketplace for Images is used to generate the cryptoboy using the NFT, Blockchain, Cryptocurrency. The generated cryptoboy can be sold and they can see who is the token owner and also token metadata. <button class="MuiButtonBase-root MuiButton-root MuiButton-contained editexp MuiButton-containedSecondary click_collections_oneclickfiledownload " onclick="location.href='https://github.com/kandikits/cryptoboys-nft-marketplace/raw/main/Kit_installer.zip'" type="button"> ⬇️ Download 1-Click Installer </button> <img src="https://nftcalendar.io/storage/uploads/events/2022/1/WjVWzwRUHNbRCZxbCUyes22S8IXppiMlRpZXm9Y2.gif" width="500" height="500" > <h3>Features:</h3> 1)Mint custom ERC721 implemented Crypto Boy Tokens. 2)Sell Crypto Boy tokens on the marketplace. 3)Set desired token price. 4)Toggle between keeping the token for sale and not for sale. 5)Keeps track of all the tokens owned by an account - minted and bought. 6)Query blockchain for the token owner and token metadata. 7)User can mint a token only after every 5 minutes. <img src="https://raw.githubusercontent.com/devpavan04/cryptoboys-nft-marketplace/main/image.png" width="500" height="500"> <b>Scope:</b> NFTs used in cryptoboy are digitally unique, no two NFTs are the same. Every NFT used in cryptoboy must have an owner and this is of public record and easy for anyone to verify. <h3>Technological Innovation:</h3> <b>1.NFT:</b> NFTs are unique cryptographic tokens that exist on a blockchain and they cannot be replaced or copied/paste a new NFT into existence it is recorded in a blockchain. And that is used to certify authenticity and ownership as a digital asset. It’s generally built using the same kind of programming as cryptocurrency, like Bitcoin or Ethereum, but that’s where the similarity ends. <b>2.Blockchain:</b> Blockchain is a system it is used to record information in a way it makes difficult or impossible to change, hack, or cheat the system. A blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. The primary use of blockchains is as a distributed ledger for cryptocurrencies such as bitcoin. <b>3.Cryptocurrencies:</b> Mostly cryptocurrencies use blockchain technology to record transactions, in which transactions are verified and records maintained by a decentralized system using cryptography, rather than by a centralized authority. <h3> Browser Extension</h3> <b>Metamask:</b> MetaMask-extension library is a software cryptocurrency wallet used to interact with the Ethereum blockchain. It allow users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications. <h3>Stack</h3> <b>Solidity</b> - Object-oriented, high-level language for implementing smart contracts. <b>Bootstrap 4</b> - CSS framework for faster and easier web development. <b>React.js</b> - JavaScript library for building user interfaces. <b>web3.js</b> - Allow users to interact with a local or remote ethereum node using HTTP, IPC or WebSocket. <b>Truffle</b> - Development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM). <b>Ganache</b> - Personal blockchain for Ethereum development used to deploy contracts, develop DApps, and run tests. <h3>Troubleshooting:</h3> 1. While running batch file, if you encounter Windows protection alert, select More info --> Run anyway. 2. During kit installer, if you encounter a Windows security alert, click Allow. 3. Ensure Ganache is open before running the 1-Click Installer. 4. Make sure you have chosen the Ganache Network in the Metamask Extension. 5. Sometimes you may face the "out of gas error" to resolve this error, edit the "Gas Limit". 6 .Sometimes after npm start it throw's an error as create the .env file. For that create the .env file inside the project SKIP_PREFLIGHT_CHECK=true .

kandi

1-Click Install

akshara-kit2

Python Libraries for Applications

Python is known for its general-purpose nature which makes it applicable in almost every domain of software development. Python makes its presence in every emerging field. It provides very high-level dynamic data types and supports dynamic type checking. It is the fastest-growing programming language and can develop any application. It was created by Guido van Rossum during 1985 - 1990. It supports functional and structured programming methods as well as OOP. It can be used as a scripting language or can be compiled to byte-code. <center><img src="http://drive.google.com/uc?export=view&id=1RojXcakMc7P1GNkZXzH4bB63t4Y-cVGp" width="305" height="265" ></center> <b>Advantages of Python : </b> <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Interpreted <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Interactive <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is Object-Oriented <img src="http://drive.google.com/uc?export=view&id=1NB7WNOSYxqritGe2-4xzNC5wVEeayxTb" width="46" height="42" align = "left" HSPACE="20" VSPACE="5" / > Python is a Beginner's Language

Trending Discussions on Server

    psql: error: connection to server on socket &quot;/tmp/.s.PGSQL.5432&quot; failed: No such file or directory
    Error: require() of ES modules is not supported when importing node-fetch
    Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
    The unauthenticated git protocol on port 9418 is no longer supported
    CentOS through a VM - no URLs in mirrorlist
    Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
    Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'
    ESlint - Error: Must use import to load ES Module
    throwError(error) is now deprecated, but there is no new Error(HttpErrorResponse)
    How to open emulators in different windows at Android Studio (Bumblebee | 2021.1.1)?

QUESTION

psql: error: connection to server on socket &quot;/tmp/.s.PGSQL.5432&quot; failed: No such file or directory

Asked 2022-Apr-04 at 15:46

Not really sure what caused this but most likely exiting the terminal while my rails server which was connected to PostgreSQL database was closed (not a good practice I know but lesson learned!)

I've already tried the following:

  1. Rebooting my machine (using MBA M1 2020)
  2. Restarting PostgreSQL using homebrew brew services restart postgresql
  3. Re-installing PostgreSQL using Homebrew
  4. Updating PostgreSQL using Homebrew
  5. I also tried following this link but when I run cd Library/Application\ Support/Postgres terminal tells me Postgres folder doesn't exist, so I'm kind of lost already. Although I have a feeling that deleting postmaster.pid would really fix my issue. Any help would be appreciated!

ANSWER

Answered 2022-Jan-13 at 15:19

Resetting PostgreSQL

My original answer only included the troubleshooting steps below, and a workaround. I now decided to properly fix it via brute force by removing all clusters and reinstalling, since I didn't have any data there to keep. It was something along these lines, on my Ubuntu 21.04 system:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6

Now I have:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9

And sudo -u postgres psql works fine. The service was started automatically but it can be done manually with sudo systemctl start postgresql.

Incidentally, I can recommend the PostgreSQL docker image, which eliminates the need to bother with a local installation.

Troubleshooting

Although I cannot provide an answer to your specific problem, I thought I'd share my troubleshooting steps, hoping that it might be of some help. It seems that you are on Mac, whereas I am running Ubuntu 21.04, so expect things to be different.

This is a client connection problem, as noted by section 19.3.2 in the docs.

The directory in my error message is different:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12

I checked what unix sockets I had in that directory:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21

Makes sense, there is a socket for 5433 not 5432. I confirmed this by running:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25

This explains how it got into this mess on my system. The default port is 5432, but after I upgraded from version 12 to 14, the server was setup to listen to 5433, presumably because it considered 5432 as already taken. Two alternatives here, get the server to listen on 5432 which is the client's default, or get the client to use 5433.

Let's try it by changing the client's parameters:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25$ sudo su postgres -c &quot;psql --port=5433&quot;
26psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
27Type &quot;help&quot; for help.
28
29postgres=#
30

It worked! Now, to make it permanent I'm supposed to put this setting on a psqlrc or ~/.psqlrc file. The thin documentation on this (under "Files") was not helpful to me as I was not sure on the syntax and my attempts did not change the client's default, so I moved on.

To change the server I looked for the postgresql.conf mentioned in the documentation but could not find the file. I did however see /var/lib/postgresql/14/main/postgresql.auto.conf so I created it on the same directory with the content:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25$ sudo su postgres -c &quot;psql --port=5433&quot;
26psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
27Type &quot;help&quot; for help.
28
29postgres=#
30port = 5432
31

Restarted the server: sudo systemctl restart postgresql

But the error persisted because, as the logs confirmed, the port did not change:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25$ sudo su postgres -c &quot;psql --port=5433&quot;
26psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
27Type &quot;help&quot; for help.
28
29postgres=#
30port = 5432
31$ tail /var/log/postgresql/postgresql-14-main.log
32...
332021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address &quot;127.0.0.1&quot;, port 5433
342021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5433&quot;
352021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
362021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
37

After other attempts did not succeed, I eventually decided to use a workaround: to redirect the client's requests on 5432 to 5433:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25$ sudo su postgres -c &quot;psql --port=5433&quot;
26psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
27Type &quot;help&quot; for help.
28
29postgres=#
30port = 5432
31$ tail /var/log/postgresql/postgresql-14-main.log
32...
332021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address &quot;127.0.0.1&quot;, port 5433
342021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5433&quot;
352021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
362021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
37ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
38

This is what I have now:

copy icondownload icon

1sudo pg_dropcluster --stop 12 main
2sudo pg_dropcluster --stop 14 main
3sudo apt remove postgresql-14
4sudo apt purge postgresql*
5sudo apt install postgresql-14
6$ pg_lsclusters
7Ver Cluster Port Status Owner    Data directory              Log file
814  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
9$ sudo su postgres -c &quot;psql&quot;
10psql: error: connection to server on socket &quot;/var/run/postgresql/.s.PGSQL.5432&quot; failed: No such file or directory
11        Is the server running locally and accepting connections on that socket?
12$ ls -lah /var/run/postgresql/
13total 8.0K
14drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
15drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
16drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
17drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
18-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
19srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
20-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
21$ pg_lsclusters
22Ver Cluster Port Status                Owner    Data directory              Log file
2312  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
2414  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
25$ sudo su postgres -c &quot;psql --port=5433&quot;
26psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
27Type &quot;help&quot; for help.
28
29postgres=#
30port = 5432
31$ tail /var/log/postgresql/postgresql-14-main.log
32...
332021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address &quot;127.0.0.1&quot;, port 5433
342021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket &quot;/var/run/postgresql/.s.PGSQL.5433&quot;
352021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
362021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
37ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
38$ ls -lah /var/run/postgresql/
39total 8.0K
40drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
41drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
42drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
43drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
44-rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
45lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -&gt; /var/run/postgresql/.s.PGSQL.5433
46srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
47-rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
48

This means I can now just run psql without having to explicitly set the port to 5433. Now, this is a hack and I would not recommend it. But in my development system I am happy with it for now, because I don't have more time to spend on this. This is why I shared the steps and the links so that you can find a proper solution for your case.

Source https://stackoverflow.com/questions/69754628