<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Muhammad Zeeshan</title>
    <description>The latest articles on Forem by Muhammad Zeeshan (@muhammadzeeshan03).</description>
    <link>https://forem.com/muhammadzeeshan03</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1065428%2F5b1d3e23-2cc4-4686-a284-6d153872a08a.png</url>
      <title>Forem: Muhammad Zeeshan</title>
      <link>https://forem.com/muhammadzeeshan03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/muhammadzeeshan03"/>
    <language>en</language>
    <item>
      <title>Apache AGE:Code Style Guide</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Sun, 24 Sep 2023 11:24:15 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/apache-agecode-style-guide-52c5</link>
      <guid>https://forem.com/muhammadzeeshan03/apache-agecode-style-guide-52c5</guid>
      <description>&lt;p&gt;In this blog we will look at the coding style guide to make a pull request in Apache AGE repository. In our previous blog we explored that how we can create a PR in apache AGE repository. If you want to know about doing a &lt;a href="https://dev.to/muhammadzeeshan03/creating-a-pull-request-to-any-open-source-project-like-apache-age-a34"&gt;Pull request to Apache AGE&lt;/a&gt; you can checkout this blog first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Indentation
&lt;/h2&gt;

&lt;p&gt;In AGE's official coding style guide they mentioned about using 4 spaces per indentation level instead of using a tab for indentation. Use the same method to indent code even working with switch statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;switch (suffix) {
    case 'G':
    case 'g':
        mem &amp;lt;&amp;lt;= 30;
        break;
    case 'M':
    case 'm':
        mem &amp;lt;&amp;lt;= 20;
        break;
    case 'K':
    case 'k':
        mem &amp;lt;&amp;lt;= 10;
        // fall through
    default:
        break;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above we have used 4 spaces instead of a single tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breaking long lines and Strings
&lt;/h2&gt;

&lt;p&gt;Line length is 79 columns. So, if the length of code line exceeds 79 columns, move the string to next line. And if there is a case in which the String is exceeding 79 columns we don't need to break the string.&lt;/p&gt;

&lt;h2&gt;
  
  
  Placing Braces and Spaces
&lt;/h2&gt;

&lt;p&gt;All opening or closing braces are to be placed on a single line solely. Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void function(int x)
{
    body of function
}

if(x is true)
{
do task a
}
else if(y is true)
{
do task b
}
else
{
do task c
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main thing to keep in mind in the above code is braces, each opening or closing brace is placed on a single line and no code on that line.&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;
If all the bodies of if/else statements contains a single line, omit braces. Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(x is true)
    do task a
if(y is true)
    do task b
else
    do task c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Naming
&lt;/h2&gt;

&lt;p&gt;Use the underscore name convention for all variables, functions, structs, and enums.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commenting
&lt;/h2&gt;

&lt;p&gt;For multi-line comments, use C style multi-line commments. And for single line comments use the style format as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
 * This function
 * does x
 */
void f(void)
{
    // This is to check...
    if (y is true)
        we do b
/*
 * We need to do this here
 * because of ...
 */
for (;;)

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  NewLines
&lt;/h2&gt;

&lt;p&gt;For newlines, only \n is allowed, not \r\n and \r.&lt;/p&gt;

&lt;h2&gt;
  
  
  Note
&lt;/h2&gt;

&lt;p&gt;For a list of all the coding style guidelines, visit the &lt;a href="https://github.com/apache/age/blob/master/clang-format.5"&gt;clang-format.5&lt;/a&gt; in the official AGE git repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://age.apache.org/contribution/guide/#code-style-guilde"&gt;https://age.apache.org/contribution/guide/#code-style-guilde&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheag</category>
      <category>coding</category>
      <category>postgres</category>
      <category>database</category>
    </item>
    <item>
      <title>Creating a pull request to any open source project like Apache AGE</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Fri, 15 Sep 2023 16:12:33 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/creating-a-pull-request-to-any-open-source-project-like-apache-age-a34</link>
      <guid>https://forem.com/muhammadzeeshan03/creating-a-pull-request-to-any-open-source-project-like-apache-age-a34</guid>
      <description>&lt;p&gt;I was working on an open source project Apache AGE. I have done so many PR's in my local repo project. But doing a Pull request to an open source project is a bit different from doing it in your local repository. &lt;br&gt;
For this i assumed that you have github setup on system if no you can follow &lt;a href="https://dev.to/muhammadzeeshan03/getting-started-with-git-and-github-beginners-guide-mah"&gt;this blog&lt;/a&gt;. So, let's get started. &lt;/p&gt;
&lt;h2&gt;
  
  
  Forking the Repository
&lt;/h2&gt;

&lt;p&gt;It's the very first step you need to do before creating a pull request. Forking a github repo will create a copy of the project that you forked under your account. So, to fork AGE repository you need to go to AGE's source code. Then fork the repo and it will create the copy under your account.&lt;/p&gt;
&lt;h2&gt;
  
  
  Clone
&lt;/h2&gt;

&lt;p&gt;Next step is clonning the repository. This step will clone the AGE's source code into your working environment. And to clone the code you can use the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone path_to_the_repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;replace the &lt;code&gt;path_to_the_repo&lt;/code&gt; with the path of your copy of AGE's source code. This will make sure that the code is now available on your computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch Creation
&lt;/h2&gt;

&lt;p&gt;Create a new branch. In this branch you will complete your task and will add your task as a branch in AGE repository. To create a branch you can run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b branch_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the branch_name with the name of the branch that you want to set. This command will create a new branch and checkout to that branch as well. If the branch already exists it simply checkout to that and if not it will create a branch with that name and then checkout to that. If you are using &lt;code&gt;vs code&lt;/code&gt; you can also create a branch by using git/github extension of vscode. &lt;/p&gt;

&lt;h2&gt;
  
  
  Add and commit your task
&lt;/h2&gt;

&lt;p&gt;Now everything is setup. No you need to do your changes that you want to add or remove code in the AGE's repo. Now it's time to complete your task. After completing your task you need to push it to your repository. For that you need to run the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add. 
git commit -m "Your commit message"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These two commands will add your changes to stages and then add the commit message. You can replace the &lt;code&gt;your commit message&lt;/code&gt; with the message you want to add. Let's say you have changed a data types of some variables you can replace it with changed/updated the data types and so.  &lt;/p&gt;

&lt;p&gt;Now after this push the changes to github.&lt;br&gt;
For this use the commad.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it's not working or giving some upstream warning. You can also use this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push --set-upstream origin branch_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will push all the changes to your copy of code on the github. Now the next and final step is creating a Pull Request to the AGE's source code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Pull request
&lt;/h2&gt;

&lt;p&gt;For this you need to go to your local copy of AGE's code. Click on the &lt;code&gt;New pull request&lt;/code&gt; button. This will redirect to a page where you have to set the base repository and then its base branch. Make sure these both are the one that you need to create a PR to. After that there will be an option of compare branch. Set that to the branch that you just created. &lt;br&gt;
Then add title and description of the PR. These could be something that explains what you have done in your code and what problem you solved. After adding these click on create pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Note
&lt;/h2&gt;

&lt;p&gt;To get you work merged you need to follow the community guidlines to create a pull request. For that you can check this &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/rrrokhtar/guide-for-creating-pull-requests-on-apache-age-1nkm"&gt;https://dev.to/rrrokhtar/guide-for-creating-pull-requests-on-apache-age-1nkm&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Query Planning: How citus plans query</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 14 Sep 2023 13:04:10 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/query-planning-how-citus-plans-query-3m5i</link>
      <guid>https://forem.com/muhammadzeeshan03/query-planning-how-citus-plans-query-3m5i</guid>
      <description>&lt;h2&gt;
  
  
  Distributed query planner
&lt;/h2&gt;

&lt;p&gt;When a SQL query references a Citus table during execution, the distributed query planner produces a PostgreSQL query plan that contains a Custom Scan node, which contains the distributed query plan.&lt;/p&gt;

&lt;p&gt;A distributed query plan constists of the following tasks.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Queries on shards to run on the worker nodes.&lt;/li&gt;
&lt;li&gt;A set of subplans whose result need to be broadcast or re-partitioned.&lt;/li&gt;
&lt;li&gt;It has four main query planning strategies to scale and to distribute the queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EiE_BAo0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/278ggux7cdr57prpbk98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EiE_BAo0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/278ggux7cdr57prpbk98.png" alt="4 strategies" width="474" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A: Fast Path Planner
&lt;/h2&gt;

&lt;p&gt;It handles and work for simple queries like create read, update, and delete i.e, CRUD queries on a single table with a single distributed column value. It works by extracting the distributed column value directly from a filter in the query and determines the value of shard that matched with that value.&lt;/p&gt;

&lt;p&gt;Planner then rewrites the name of the table to the shard name that matches the value in the column and construct the query to run on the worker node, this task is done with the minimal usage of the CPU overhead. &lt;/p&gt;

&lt;h2&gt;
  
  
  B:Router Planner
&lt;/h2&gt;

&lt;p&gt;It handles arbitrary complex queries, that can be scoped to one set of co-located shards. It works by checking and infering whether all distributed tables have the same distributed column filters or not. If so, it then rewrites the table name in the query to the names of the co-located shards that matches the distributed column value. It supports all SQL features that PostgreSQL supports since it will simply delegate the full query to another PostgreSQL server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iwhent_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9t1b59mz2qkpwa8llxs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iwhent_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9t1b59mz2qkpwa8llxs.png" alt="Worker nodes" width="339" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  C: Logical Push Planner
&lt;/h2&gt;

&lt;p&gt;It works by detecting whether the join tree( queries that have some joins statements) can be fully pushed down. This requires that all the distributed tables have co-located joins between them and subqueries do not require a global merger step. In this a &lt;strong&gt;GROUP BY&lt;/strong&gt; must include the distribution column. If so, the distribution planner can be largely agnostic to the SQL constructs being used woth the join tree, because they can be fully delegated to the worker nodes, and so our distribution query planner can work in planer. &lt;/p&gt;

&lt;h2&gt;
  
  
  D: Logical Join Order Planner
&lt;/h2&gt;

&lt;p&gt;It determines the optimal execution order for join tree which involves joins that are &lt;strong&gt;not co-located&lt;/strong&gt;. Firsly, it evaluates all possible join order between distributed tables and subqueries using co-located joins, broadcast joins and re-partition joins. And after evaluation it chooses the order that minimizes the network traffic. From the mentioned joins broadcst and re-partition joins results in subplans that includes the filter and projections pushed into the subplan.&lt;/p&gt;

&lt;p&gt;These above are the main four plans that Citus cinsiders while query execution. For each query, Citues iterates over these four planners, from lowest to highest overhead. Then it uses the planner that can plan and executes that query with minimum overhead. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GpyYqiVj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvgogbmu2f6wzk05yi9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GpyYqiVj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvgogbmu2f6wzk05yi9b.png" alt="Quey Planner" width="549" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So, to sum up the query planner, Citus &lt;strong&gt;Distributed query planner&lt;/strong&gt; takes a SQL query and then plans it for distributed execution. Then after performing some optimizations planner breaks the query into two parts. The &lt;strong&gt;coordinatoe query&lt;/strong&gt; which runs on the coordinator and worker query fragments which runs on individual shards on the worker. Planner then assign these fragments to the workers keeping in view the best utilization of its resources. After this query has been passed to the Distributed query executor for execution.  &lt;/p&gt;

</description>
      <category>database</category>
      <category>citus</category>
      <category>postgres</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Step by Step Guide to Install Citus: Linux</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Tue, 05 Sep 2023 16:26:00 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/step-by-step-guide-to-install-citus-linux-2jkh</link>
      <guid>https://forem.com/muhammadzeeshan03/step-by-step-guide-to-install-citus-linux-2jkh</guid>
      <description>&lt;p&gt;This blog is the continuation of &lt;a href="https://dev.to/muhammadzeeshan03/citus-introduction-304a"&gt;last blog&lt;/a&gt;. Where we explored about citus. In this blog we will look at the two different ways to install citus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method 1
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Packaging repo
&lt;/h2&gt;

&lt;p&gt;If you already have PostgreSQL installed its better to install the citus using this method.Run the following commands. &lt;br&gt;
Install packages on ubuntu.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://install.citusdata.com/community/deb.sh &amp;gt; add-citus-repo.sh
sudo bash add-citus-repo.sh
sudo apt-get -y install postgresql-15-citus-12.0  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install the citus and the compatible postgres version. Citus version 12 and Postgres version 15.&lt;/p&gt;

&lt;p&gt;add Citus to your local PostgreSQL database, add the following to &lt;code&gt;postgresql.conf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shared_preload_libraries = 'citus'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Method 2: Install using source code.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;create the required directories. Open the terminal and run the commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir citus
cd citus
mkdir pg
cd pg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;Install required dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3
&lt;/h2&gt;

&lt;p&gt;Download and install postgres. In method one it automatically installed the postgres but here we need to download and install it manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://ftp.postgresql.org/pub/source/v15.3/postgresql-15.3.tar.gz &amp;amp;&amp;amp; tar -xvf postgresql-15.3.tar.gz &amp;amp;&amp;amp; rm -f postgresql-15.3.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd postgresql-15.3

# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

# now install
make install

# go back to main citus directory
cd ../../
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4
&lt;/h2&gt;

&lt;p&gt;Now after installing postgres we need to install citus. Before that we need to install the required dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install -y postgresql-server-dev-15 postgresql-15 \
                        autoconf flex git libcurl4-gnutls-dev 
libicu-dev \
                        libkrb5-dev liblz4-dev libpam0g-dev libreadline-dev \
                        libselinux1-dev libssl-dev libxslt1-dev libzstd-dev \
                        make uuid-dev

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5
&lt;/h2&gt;

&lt;p&gt;Clone citus using the github repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/citusdata/citus.git
cd citus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6
&lt;/h2&gt;

&lt;p&gt;Install and configure citus&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PG_CONFIG=/home/username/citus/pg/postgresql-15.3/bin/pg_config ./configure
make
sudo make install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running this config comamnd Here you can have an error that some dependencies are missing. You can run the command with --without flag or can download those dependencies.&lt;/p&gt;

&lt;p&gt;You have successfully installed citus and postgres from the source code or using package. To load you again need to add the above &lt;code&gt;prelaod&lt;/code&gt; command in &lt;code&gt;postgresql.conf&lt;/code&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>citus</category>
      <category>database</category>
      <category>bitnine</category>
    </item>
    <item>
      <title>Citus Introduction</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 31 Aug 2023 10:06:23 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/citus-introduction-304a</link>
      <guid>https://forem.com/muhammadzeeshan03/citus-introduction-304a</guid>
      <description>&lt;p&gt;In the evolving landscape of data management, the challenges of horizontal scaling are becoming crucial. Citus is an open-source extension for PostgreSQL that gives it the power of scalability with distrubuted tables. It takes the strength of PostgreSQL's data integrity and combines it with the scalability and performance of a distributed database management. In this blog we will explore about citus, about how it handles large-scale data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Traditionally relational databases like SQL and PostgreSQL maintains data integrity and along with that also provides powerful querying capability. PostgreSQL is one of the mist popular open source database management system. One of the main issue or the limitation we can say is dealing with extremely large data sets which requires high concurrency demand. Citus addresses these challenges by providing a solution of architecture that spread all the data across different or multiple  nodes. Which enables better hardware resource management and improvement in performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Citus Architecture
&lt;/h2&gt;

&lt;p&gt;Citus is designed in such a way that a in a citus cluster, all servers run PostgreSQL having citus extension along with other number of extensions installed. Citus mainly uses the PostgreSQL's extension API's to change the behaviour of database in two ways.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It replicates database objects, which mainly includes custom types and function, to all servers.&lt;/li&gt;
&lt;li&gt;It add two new table types that are used to take the advantages of the additional servers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iFMuRwSP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idvsemva3mup3ezhskwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iFMuRwSP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idvsemva3mup3ezhskwv.png" alt="Citus image" width="654" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It basically uses the sharding mechanism to deal with scalability. Which means it divide the large datasets into different managable parts called &lt;code&gt;chunks&lt;/code&gt; or &lt;code&gt;shards&lt;/code&gt; and then divides these chunks on different nodes. It manages the query very intelligently by sending those to the relevant node and then collection result from those.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Horizontal Scalability:
&lt;/h3&gt;

&lt;p&gt;It allows us to divide or distribute our data across multiple nodes, allowing us to scale out by adding more computer or machines to our cluster instead of vertically scaling by increasing the power of already machines we have to manage our workload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parallel Processing
&lt;/h3&gt;

&lt;p&gt;As our data is distributed across multiple nodes, so citus can execute queries in parallel which in turns combines the query processing power from all nodes and to speed up performance. It can speed up query porcessing by 20x to 300x or more times with the help of this parallelism.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s4UJUY9u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnt5mnjh2caffifng5cy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s4UJUY9u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bnt5mnjh2caffifng5cy.png" alt="Query Processing" width="590" height="480"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  High Throughput
&lt;/h3&gt;

&lt;p&gt;It is well suited and optimized for large-scale data application. As it uses different nodes to process high volume of data and queries which helps it to prevent different bottlenecks and ensure highly efficient utilzation of resources. &lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-Tenancy
&lt;/h3&gt;

&lt;p&gt;Citus can be used to build multi-tenant applications, in which data is stored across separate distrubuted tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ease of use
&lt;/h3&gt;

&lt;p&gt;Because of its compatibility with POstgreSQL, you can use familiar PostgreSQL tools, extensions and techniques. So you can also easily use and learn Citus if you are familar with PostgreSQL. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;It provides a strength to relational database having an option to scale it horizontally. Making it a good choice for all the user applications that are in need of both powerful query capability and handle large-data along with concurrent users. It's main use case is in real-time analytics, large-scale applications where we need high power system so instead of vertical scaling we can do the same job using horizontal scaling of Citus. &lt;/p&gt;

</description>
      <category>database</category>
      <category>postgressql</category>
      <category>citus</category>
      <category>programming</category>
    </item>
    <item>
      <title>Running Apache AGE using docker</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 24 Aug 2023 16:27:03 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/running-apache-age-using-docker-5m9</link>
      <guid>https://forem.com/muhammadzeeshan03/running-apache-age-using-docker-5m9</guid>
      <description>&lt;p&gt;This blog is the continuation of last blog. In this blog we will run Apache AGE using docker. In our last blog we worked on setup of docker. So, if you are new to docker you can first follow &lt;a href="https://dev.to/muhammadzeeshan03/setting-up-docker-on-linux-apache-age-a-step-by-step-guide-1953"&gt;this blog&lt;/a&gt;. And then start working on this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE, which is an extension of PostgreSQL. It's a graphical representation of relational database. You can setup and install AGE on docker.&lt;/p&gt;

&lt;p&gt;Run the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull apache/age
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your docker is setup properly it will pull Apache AGE from the docker hub. In our last blog we also setup docker hub.&lt;br&gt;
If everything is successful it will show an output of this type.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0D4rb_B3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blct04fy2pyru5zsdxx1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0D4rb_B3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blct04fy2pyru5zsdxx1.jpeg" alt="installed image" width="800" height="437"&gt;&lt;/a&gt;&lt;br&gt;
You have successfully pulled the apache AGE from the doecker hub. Now its time to configure and run the docker image. &lt;br&gt;
And for that we need to setup a few things. like port, User, password and database. To setup these all you can run the commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run \
    --name age  \
    -p 5455:5432 \
    -e POSTGRES_USER=postgresUser \
    -e POSTGRES_PASSWORD=postgresPW \
    -e POSTGRES_DB=postgresDB \
    -d \
    apache/age
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it successful, it will return the container id. This will setup an and run the apache AGE container. To check the running container you can run the commad.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show all the running containers.&lt;br&gt;
To see the list of all containers irrespective of those are running or not you can add &lt;code&gt;-a&lt;/code&gt; flag to the above command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker ps -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to start or stop a specific container you can run the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop container-name
docker start container-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check all the images that you have on your machine locally you can run the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker images
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all for this time. Happy learning!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hub.docker.com/r/apache/age"&gt;https://hub.docker.com/r/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>database</category>
      <category>installation</category>
      <category>bitnine</category>
    </item>
    <item>
      <title>Setting Up Docker on Linux Apache AGE: A step-by-Step Guide</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 17 Aug 2023 20:14:29 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/setting-up-docker-on-linux-apache-age-a-step-by-step-guide-1953</link>
      <guid>https://forem.com/muhammadzeeshan03/setting-up-docker-on-linux-apache-age-a-step-by-step-guide-1953</guid>
      <description>&lt;p&gt;In this blog we will look and explore about docker.  How we can install it on linux Operating system and in next blogs we will look at how we can setup our developer environment to run Apache AGE image using docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Docker is an open-source plateform for building, scaling, shipping and management of applications inside portable containers. Containers are basically isolated working environemnts that allows user to package their working application along with its required dependencies. And allow them to run it consistently across different devices having different working environemnt. It can be used for various purposes like application isolation, portability, version control,microservices and resource efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;There are different ways to install dokcer on linux. You can check all those from docker &lt;a href="https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository"&gt;official webiste&lt;/a&gt;. In this we will look at one of the easiet way to install.&lt;/p&gt;

&lt;p&gt;Before installing docker for the first time on our machine. We need to setup docker repository. And after that we can install and update docker from the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;Update the apt packages and install required dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;Add docker's official &lt;code&gt;GPG key&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3
&lt;/h2&gt;

&lt;p&gt;Setup docker repository on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release &amp;amp;&amp;amp; echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4
&lt;/h2&gt;

&lt;p&gt;Update the apt package index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything is setup now. We only need to install the latest version of docker.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Command given above may take some time depending upon the network speed. After installation you can us docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Check
&lt;/h2&gt;

&lt;p&gt;To check if it is successfully installed or not you can run this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; &lt;br&gt;
If you have any permission error or issues like this one&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zt2PRmtV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ck5dnyko39j2uq4u5tz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zt2PRmtV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ck5dnyko39j2uq4u5tz.png" alt="pemission issues" width="800" height="48"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you need to create an account on &lt;a href="https://hub.docker.com/"&gt;docker hub&lt;/a&gt;.&lt;br&gt;
After creating an account you can login using terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker login -u your_user_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will ask for user password that you entered on the time of creation of account on docker hub. Provide that password. It will show login succeeded.&lt;/p&gt;

&lt;p&gt;In the next blog we will look at how we can setup and use apache AGE using docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;(&lt;a href="https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository"&gt;https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://blog.idrisolubisi.com/how-to-fix-error-response-from-daemon-pull-access-denied-for-yourusernameyourrepository"&gt;https://blog.idrisolubisi.com/how-to-fix-error-response-from-daemon-pull-access-denied-for-yourusernameyourrepository&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.australtech.net/top-tips-to-install-docker-on-ubuntu-18-04/"&gt;https://www.australtech.net/top-tips-to-install-docker-on-ubuntu-18-04/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>installation</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Graph Database: Apache AGE.</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 10 Aug 2023 19:54:22 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/graph-database-apache-age--463e</link>
      <guid>https://forem.com/muhammadzeeshan03/graph-database-apache-age--463e</guid>
      <description>&lt;p&gt;Hi, In this blog we will be looking and exploring what is a graph database. Its applications, advantages and how Apache AGE can help us in this regards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Graph Database
&lt;/h2&gt;

&lt;p&gt;A graph database is a special type of database which is used to manage our data. From the very begining data has been an important part of the computer. And we have different ways to store, process and show that data. Traditional ways are relational databases. In relational databases we store data in tables with some predefined schemas for that table. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rYwwWgtg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmczdd2gcfhcx8ag4m0n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rYwwWgtg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmczdd2gcfhcx8ag4m0n.png" alt="Schema" width="800" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And we store data in the table based on that specific schema. Infact we can't store anything that does not match with that schema. &lt;/p&gt;

&lt;p&gt;On the other hand, Graph databases organize data in the form of nodes and edges instead of table and documents. Infact, it shows the data as node and relationalship between the data as an edge between the data. &lt;br&gt;
A graph database is more easy to understand relations between the data as compared to traditional database. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AJgLKKb0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xo7a3nzaar9azylvr25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AJgLKKb0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xo7a3nzaar9azylvr25.png" alt="Graph database image" width="743" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Understanding relation between data is much easier through the image above as compared with the simple tables of these data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;. It uses graph structure to explain relation between data and connect them using edges between data. In this way we can easily visualize complex relations.&lt;br&gt;
&lt;strong&gt;2&lt;/strong&gt;. As it stores data on nodes. So, nodes can also store some metadata which can provide us some additional information.&lt;br&gt;
&lt;strong&gt;3&lt;/strong&gt;. It's easy to traverse a graphed structure database to navigate from one node to the other one through the defined relation. This traversing capability enables very fast and efficient querying of difficult to understand relationships.&lt;br&gt;
&lt;strong&gt;4&lt;/strong&gt;. As tables database required predefined schema. Graph database are flexible towards these predefined schema. They allow nodes and relationship to have different properties and structures.&lt;br&gt;
&lt;strong&gt;5&lt;/strong&gt;. These graph databases are so designed to manage the relationship between nodes elegantly. As compared to complex joins in traditional database, graph database can get the data from databse more quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apache AGE:
&lt;/h2&gt;

&lt;p&gt;Apache AGE is a PostgreSQL extension that provides the graph databse functionality over the top of PostgreSQL. AGE stands for A Graph Extension. You can learn more about &lt;a href="https://age.apache.org/age-manual/master/intro/overview.html"&gt;Apache AGE&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It provides many functionalities like hybrid queries, fast graph query processing graph visualization and analytics and much more. &lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://age.apache.org/download"&gt;https://age.apache.org/download&lt;/a&gt;&lt;br&gt;
&lt;a href="https://neo4j.com/developer/graph-database/"&gt;https://neo4j.com/developer/graph-database/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>postgres</category>
      <category>apache</category>
    </item>
    <item>
      <title>Debugging AGE source code using VSCode.</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Fri, 21 Jul 2023 15:50:37 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/debugging-age-source-code-using-vscode-41fo</link>
      <guid>https://forem.com/muhammadzeeshan03/debugging-age-source-code-using-vscode-41fo</guid>
      <description>&lt;p&gt;Hi, In today's blog we will be exploring how we can setup our working environment to attach a debugger and debug AGE source code. &lt;/p&gt;

&lt;p&gt;We will be adding some breakpoints at random files in the code just to make sure that debugger has been  attached. In further blogs we will see how we can debug custom functions. &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AGE and PostgreSQL Source code/installed&lt;/li&gt;
&lt;li&gt;VSCode&lt;/li&gt;
&lt;li&gt;GDB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can checkout this blog to &lt;a href="https://dev.to/muhammadzeeshan03/install-postgresql-16beta1-and-age-along-with-possible-error-solutions-3ma8"&gt;install AGE and PostgreSQL&lt;/a&gt; on you machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 1
&lt;/h2&gt;

&lt;p&gt;First of all go to the directory where postgres is installed. And start postgres. In my case its the folder named,  &lt;strong&gt;postgresql-16beta1&lt;/strong&gt; So,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd postgresql-16beta1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then initialize a database cluster.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/initdb demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the server using the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/pg_ctl -D demo -l logfile start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create a database named demodb.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/createdb demodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the PostgreSQL server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/psql demodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running above commands you will see a terminal like this. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6omrH2dV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3ws2hgrle40ndvw1ok4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6omrH2dV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3ws2hgrle40ndvw1ok4.png" alt="DemoDB" width="768" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now run the command to check the backendId where postgres is running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT pg_backend_pid();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For now we are done with PostgreSQL directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 2
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Open AGE directory in the VS-Code.&lt;/strong&gt;&lt;br&gt;
Install these two VS-Code extensions if you don't have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P6dpFoJv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7rq1j0kg6nq4uq7luehb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P6dpFoJv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7rq1j0kg6nq4uq7luehb.png" alt="VS code Extensions" width="482" height="199"&gt;&lt;/a&gt;&lt;br&gt;
After installing these extensions press F5. You will be directed to Configure Debugger for the code. It will open &lt;/p&gt;

&lt;p&gt;&lt;code&gt;launch.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    // 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": "(gdb) Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "/home/zeeshan/age16/pg/postgresql-16beta1/bin/postgres",
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Set Disassembly Flavor to Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        }


    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit this line in the Launch.json file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"program": "/home/zeeshan/age16/pg/postgresql-16beta1/bin/postgres",&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In my case postgres16-beta is installed in age16 and then in pg directory. Change it with path where you have installed PostgreSQL.&lt;br&gt;
Save changes, &lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 3
&lt;/h2&gt;

&lt;p&gt;Again press F5, this time you will be asked to add process Id. Paste the backend-id that you copied from PostgreSQL after running command &lt;code&gt;SELECT pg_backend_pid();&lt;/code&gt;.&lt;br&gt;
If it successful you will be asked to enter your device password. Enter the password.&lt;/p&gt;

&lt;p&gt;Now add some random breakpoints in cypher_clause.c and cypher_analyze.c file(These files are in AGE's folder under src-&amp;gt;backend-&amp;gt;parser).&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4
&lt;/h2&gt;

&lt;p&gt;Head back to PostgreSQL terminal where you are in demodb database. &lt;/p&gt;

&lt;p&gt;Load Age extension.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try some cypher queries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT create_graph('demo_graph');
SELECT * FROM cypher('demo_graph', $$ CREATE (n:Person {name : "james", bornIn : "US"}) $$) AS (a agtype);
SELECT * FROM cypher('demo_graph', $$ MATCH (v) RETURN v $$) as (v agtype);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During each command debugger will start and ask you to move forward you can move into specific function and move forward using the debugger.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L5J63-JK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1xogu8q8a4xk1mier0s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L5J63-JK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1xogu8q8a4xk1mier0s.png" alt="Debug" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have successfully attached the debugger. Happy debugging :)&lt;/p&gt;

&lt;h2&gt;
  
  
  REFERENCES
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/rrrokhtar/how-to-debug-age-source-code-on-vscode-3op7"&gt;https://dev.to/rrrokhtar/how-to-debug-age-source-code-on-vscode-3op7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://imranzaheer.hashnode.dev/install-age-psql-from-source"&gt;https://imranzaheer.hashnode.dev/install-age-psql-from-source&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting Started With Git and Github: Beginner's Guide</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Fri, 30 Jun 2023 09:41:59 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/getting-started-with-git-and-github-beginners-guide-mah</link>
      <guid>https://forem.com/muhammadzeeshan03/getting-started-with-git-and-github-beginners-guide-mah</guid>
      <description>&lt;p&gt;Hi, If you are looking for a beginner guide to git and github, you are at right place. In this we will be exploring about what is git and github. And how we can push and share our code with others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today's software development system we need to share and maintain the different versions of our code. So, that developer working in a collaborative system can work on others code and can view the code of different collabotors. Git and github serve the purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git
&lt;/h2&gt;

&lt;p&gt;Git is a free and open source distributive and collaborative version controlling system. It's main purpose it to help developers in management of source code effectively. Git has changed the way developers work. Using git developers can keep track of their work, collaborate seamlessly and can manage all of their work very easily. One of it's imporatant and powerful feature is it's ability is to allow developers to create lines and version of code using branching and merging feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Github
&lt;/h2&gt;

&lt;p&gt;At high level github is code hosting platform mainly used for collaboration and version control. It helps developer in store and management of code as well as keep track of changes in the code.&lt;/p&gt;

&lt;p&gt;Let's explore how we can use both.&lt;br&gt;
For this i will be using Windows Operating system.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;First of all install git on your machine. For this you can download and install git from &lt;a href="https://git-scm.com/download/win"&gt;here&lt;/a&gt;. you can read more about git and all its features &lt;a href="https://git-scm.com/"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;After installing git restart you machine and check installation by running &lt;code&gt;git --verison&lt;/code&gt; in terminal.&lt;/p&gt;

&lt;p&gt;Now create an account on &lt;a href="https://github.com/"&gt;github&lt;/a&gt; if you don't have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bjvdOb3j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9uejafgifhwdlzp52we.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bjvdOb3j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9uejafgifhwdlzp52we.png" alt="github Sign up page" width="800" height="369"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After creating an account create a github repo to push your code.&lt;br&gt;
To create repo click new and you will be shown a page like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x0eKYzkJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tylh0ad2tm89j947i7o1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x0eKYzkJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tylh0ad2tm89j947i7o1.png" alt="Repository page" width="800" height="375"&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Add repository name. you can make this private or public. Fill required details and click create new. &lt;/p&gt;

&lt;p&gt;open terminal in the directory of your code that you want to upload to github.&lt;/p&gt;

&lt;p&gt;First of all setup your username and email.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "Your Name"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "your.email@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;replace "Your Name"  and &lt;code&gt;"your.email@example.com"&lt;/code&gt; with the name and email you want to setup.&lt;/p&gt;

&lt;p&gt;check name and password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Check
git config user.name
git config user.email

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it's time to upload code to github.&lt;/p&gt;

&lt;p&gt;run &lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Initialize the repository to current directory.&lt;/p&gt;

&lt;p&gt;Now setup the remote origin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin https://github.com/username/repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can copy this from github.&lt;/p&gt;

&lt;p&gt;Now add all the files to staging area.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To add file changes in the current directory and its subdirectories to staging area.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Commit Message"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add your commit message to keep track of code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch -M main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Setup head to main branch.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will push you code to github now open github to check your code. &lt;/p&gt;

&lt;p&gt;That's all for this part 💻 . In the later we will explore some advance features of github.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/"&gt;https://github.com/&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://git-scm.com/"&gt;https://git-scm.com/&lt;/a&gt;
&lt;/h2&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Install PostgreSQL 16beta1 and AGE, along with possible error Solution's</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Mon, 26 Jun 2023 19:14:25 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/install-postgresql-16beta1-and-age-along-with-possible-error-solutions-3ma8</link>
      <guid>https://forem.com/muhammadzeeshan03/install-postgresql-16beta1-and-age-along-with-possible-error-solutions-3ma8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Apache AGE, which is an extension of PostgreSQL. It's a graphical representation of relational database. Currently it(AGE) supports PostgreSQL version 12 and 13. We are also working on its capability to support PG15 and 16. In this, we will be installing it for PostgreSQL 16beta1 and on linux operating system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Directories
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir age16
cd age16
mkdir pg
cd pg

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install required Dependencies
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing required dependencies. Now we will first install PostgreSQL 16beta1 and then AGE.&lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://ftp.postgresql.org/pub/source/v16beta1/postgresql-16beta1.tar.gz &amp;amp;&amp;amp; tar -xvf postgresql-16beta1.tar.gz &amp;amp;&amp;amp; rm -f postgresql-16beta1.tar.gz

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will download and extract postgresql 16beta1.&lt;/p&gt;

&lt;p&gt;If it successful it will be shown like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_N_Hdair--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y43hxs02qdqbmj0yp1bq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_N_Hdair--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y43hxs02qdqbmj0yp1bq.png" alt="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y43hxs02qdqbmj0yp1bq.png" width="514" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have downloaded and extracted it successfully. Now move inside beta16 directory and install postgresql.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd postgresql-16beta1
# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

#install 
make install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There could be an error of this type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: `bison' is missing on your system. It is needed to create the
file `src/backend/parser/cypher_gram.c'. You can either get bison from a GNU mirror site
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To resolve this error you can visit this &lt;a href="https://stackoverflow.com/questions/76477533/installing-age-pg16-beside-postgresql-v16beta1-giving-bison-is-missing-while-it"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Installing it will take a bit of time. After successful installation it will show a windows like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W10WQft5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gu7nw2k9p2nhsrjzrxn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W10WQft5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gu7nw2k9p2nhsrjzrxn.png" alt="PostgreSQL installed" width="800" height="89"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now go back to main directory,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../
cd ../
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  AGE
&lt;/h2&gt;

&lt;p&gt;Clone and install AGE from sources latest repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/panosfol/age
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will clone and create a repo &lt;code&gt;age&lt;/code&gt;. Go to age directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd age
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now checkout to latest branch and install age from that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout PG16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  install
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make PG_CONFIG=/home/username/age16/pg/postgresql-16beta1/bin/pg_config install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check username, run &lt;code&gt;whoami&lt;/code&gt; and replace it in the above command. &lt;/p&gt;

&lt;p&gt;Now you can check if its successfully installed or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make PG_CONFIG=/home/username/age16/pg/postgresql-16beta1/bin/pg_config installcheck

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currently its showing 19/24 test cases failed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uPcZyVO5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd0q81ua6af6uafeie24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uPcZyVO5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd0q81ua6af6uafeie24.png" alt="Install Check" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have successfully installed it now can work on it and contribute to this.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://github.com/panosfol/age/tree/PG16"&gt;https://github.com/panosfol/age/tree/PG16&lt;/a&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  2. &lt;a href="https://ftp.postgresql.org/pub/source/v16beta1/"&gt;https://ftp.postgresql.org/pub/source/v16beta1/&lt;/a&gt;
&lt;/h3&gt;

</description>
      <category>postgressql</category>
      <category>linux</category>
      <category>database</category>
      <category>bitnine</category>
    </item>
    <item>
      <title>Feasibility of Converting RTE to PNSI</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Tue, 13 Jun 2023 15:33:46 +0000</pubDate>
      <link>https://forem.com/muhammadzeeshan03/feasibility-of-converting-rte-to-pnsi-52b2</link>
      <guid>https://forem.com/muhammadzeeshan03/feasibility-of-converting-rte-to-pnsi-52b2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this post we will be exploring about a change we are looking to implement at AGE.&lt;/p&gt;

&lt;p&gt;Before going further into details of what RTE and PNSI is, let me first explain what is the problem statement and what we are looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Statement
&lt;/h2&gt;

&lt;p&gt;PostgreSQL version 13(pg 13) uses PNSI instead of RTE in many functions. PNSI also exists in some of functions in PG11 and PG12 along with RTE as well. &lt;/p&gt;

&lt;h2&gt;
  
  
  What we are looking for?
&lt;/h2&gt;

&lt;p&gt;Find a way or research about converting RTE to PNSI in PG11 and PG12 version. If we are successful, multiple version of PostgreSQL can be closer to each other. Which can help us in development of the further versions.&lt;/p&gt;

&lt;p&gt;Now lets see what actually is RTE and PNSI.&lt;/p&gt;

&lt;h2&gt;
  
  
  RTE
&lt;/h2&gt;

&lt;p&gt;RTE stands for Range Table Entry, in the source code it is a structure RangeTblEntry. This plays an important role in the query processing of the PostgreSQL. RTE basically represents tables, subqueries in a postgresql query. It refers not only to tables or subqueries but also some results of joins and records that SQL statement operates on. It keeps data of these tables, subqueries etc. &lt;/p&gt;

&lt;p&gt;This RTE structure has many fields. Here I'm explaining some important fields from the RTE struct.&lt;/p&gt;

&lt;p&gt;One of them is &lt;code&gt;subquery&lt;/code&gt; pointer of type &lt;code&gt;Query&lt;/code&gt; which is used to hold subquery. other is jointype of type &lt;code&gt;JoinType&lt;/code&gt;which is used to hold the information about join and some other boolean flags to keep the record of different boolean values. Which is used is further processing of query.&lt;/p&gt;

&lt;h2&gt;
  
  
  PNSI
&lt;/h2&gt;

&lt;p&gt;PNSI stand for "ParseNameSpaceItem", which is a struct in parse_node.h file. Which represents an element of a namespace  list. It has various fields, various boolean flags and important thing is that it has a field for RTE as well, to hold the data that we used to store in RTE. And other fields include &lt;code&gt;p_nscolumns&lt;/code&gt; of type ParseNameSpaceColumn which is an array containing information about how to construct vars referencing corresponding element of the RTE's colnames list.&lt;/p&gt;

&lt;p&gt;And there are various flags like &lt;code&gt;p_rel_visible&lt;/code&gt; and &lt;code&gt;p_cols_visible&lt;/code&gt; that define which RTEs are accessible by &lt;br&gt;
qualified and unqualified names respectively. While processing the FROM clause various flags like &lt;br&gt;
&lt;code&gt;p_lateral_only&lt;/code&gt; and &lt;code&gt;p_lateral_ok&lt;/code&gt; they serve the purpose of  visibility to LATERAL subexpressions and errors respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relationship between RTE and PNSI
&lt;/h2&gt;

&lt;p&gt;RTE is used in older versions of PostgreSQL like pg11 and pg12. PNSI is used in PostgreSQL version 13. It &lt;br&gt;
also has a field for RTE to refer to “RangeTblEntry”. So, we can say that PNSI is an updated version of RTE &lt;br&gt;
as it provides some extra values along with RTE field. Whenever a subquery is created within a query, an &lt;br&gt;
RTE is formed to represents the information of that subquery. And in version pg13 this RTE is then &lt;br&gt;
included in the PNSI structure along with other information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion/feasibility
&lt;/h2&gt;

&lt;p&gt;According to our current research status we are unable to find a way to convert RTE to PNSI. The reason is absence of some information that is required to convert but is not available. So, for now its not feaible to convert RTE to PNSI for some versions of PG.  &lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/postgres/postgres/"&gt;https://github.com/postgres/postgres/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>apacheage</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
