git clone -b REL_17_STABLE --single-branch https://git.postgresql.org/git/postgresql.git
For Linux
{ {
"version": "0.2.0",
"configurations": [
{
"name": "PostgreSQL Launch",
"type": "cppdbg",
"request": "launch",
"program": "/home/sudarsha/Code/postgresql/install/bin/postgres",
"args": ["--single", "-D", "/home/sudarsha/Code/postgresql/install/data", "test"],
"stopAtEntry": false,
"cwd": "/home/sudarsha/Code/postgresql",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
For MacOS
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [ {
"name": "Debug postgresql",
"type": "cppdbg",
"request": "launch",
"program": "/Users/ssudarshan/Code/postgresql/install/bin/postgres", // Path to your executable
"args": ["--single", "-D", "/Users/ssudarshan/Code/postgresql/install/data", "test"],
"stopAtEntry": false,
"cwd": "/Users/ssudarshan/Code/postgresql", // "${fileDirname}",
"environment": [],
"externalConsole": true, // Set to true if your program needs console input/output
"MIMode": "lldb"
}
]
}
The path to the postgres binary should be added in the box titled C/C++ application; for example, "/home/sudarsha/git/postgresql14/install/bin/postgres"
Then click the "Apply" button. Click "Run" to start the program.
should see following in your console:
PostgreSQL stand-alone backend 14.5
backend>
You can run your commandss here, and you can press ctrl-D to exit. To start up the console again, choose the project, and click on the Run button (a green button with a play/rightarrow symbol)
(In server mode you will see the message:
LOG: database system was shut down at (current date and time) UTC
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
)
We recommend using the command line to download postgresql using git. But if you want to do it from the eclipse IDE you can do it as below.