Skip to content

Commit

Permalink
review update
Browse files Browse the repository at this point in the history
  • Loading branch information
m7hm7t committed Aug 22, 2024
1 parent 150c515 commit b096b85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/.psqlrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
\pset border 2
\setenv PAGER 'pspg --no-mouse -bX --no-commandbar --no-topbar'
\set HISTSIZE 100000
\set PROMPT1 '\n%[%033[1m%]%M %n@%/:%>-%p%R%[%033[0m%]%# '
\set PROMPT1 '\n%[%033[1m%]%M %n@%/:%> (PID: %p)%R%[%033[0m%]%# '
\set PROMPT2 ' '
20 changes: 16 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,25 @@ With the Citus cluster running you can connect to the coordinator in the first t

### Debugging in the VS code

1. Start Debugging: Press F5 to start debugging. You'll be prompted to select the running PostgreSQL process to attach the debugger to. Typically, if you're executing a psql command, you'll want to attach to a process named something like:
1. Start Debugging: Press F5 in VS Code to start debugging. When prompted, you'll need to attach the debugger to the appropriate PostgreSQL process.

2. Identify the Process: If you're running a psql command, take note of the PID that appears in your psql prompt. For example:
```
[local] citus@citus:9700 (PID: 5436)=#
```
This PID (5436 in this case) indicates the process that you should attach the debugger to.
If you are uncertain about which process to attach, you can list all running PostgreSQL processes using the following command:
```
ps aux | grep postgres
```

Look for the process associated with the PID you noted. For example:
```
postgres: citus citus [local] idle
citus 5436 0.0 0.0 0 0 ? S 14:00 0:00 postgres: citus citus
```
2. Set Breakpoints and Debug: Once the debugger attaches to the correct process, you can set breakpoints within the code. From here, you'll be able to step through the code execution, inspect variables, and fully debug the PostgreSQL instance running within the devcontainer.
4. Attach the Debugger: Once you've identified the correct PID, select that process when prompted in VS Code to attach the debugger. You should now be able to debug the PostgreSQL session tied to the psql command.

This setup provides a seamless way to troubleshoot and optimize the Citus extension by taking advantage of the integrated debugging features in VS Code.
5. Set Breakpoints and Debug: With the debugger attached, you can set breakpoints within the code. This allows you to step through the code execution, inspect variables, and fully debug the PostgreSQL instance running in your container.

### Getting and building

Expand Down

0 comments on commit b096b85

Please sign in to comment.