<?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>DEV Community: Pawan Kukreja</title>
    <description>The latest articles on DEV Community by Pawan Kukreja (@pawankukreja01).</description>
    <link>https://dev.to/pawankukreja01</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%2F1103300%2Ff13bea06-f335-4845-a8b9-56c852343cc5.jpeg</url>
      <title>DEV Community: Pawan Kukreja</title>
      <link>https://dev.to/pawankukreja01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pawankukreja01"/>
    <language>en</language>
    <item>
      <title>Introduction of Apache AGE.</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Mon, 13 Nov 2023 12:11:50 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/introduction-of-apache-age-106c</link>
      <guid>https://dev.to/pawankukreja01/introduction-of-apache-age-106c</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Apache AGE, a PostgreSQL extension, delivers robust graph database capabilities. Representing "A Graph Extension" (AGE), it draws inspiration from Bitnine's variant of PostgreSQL 10, AgensGraph—a versatile multi-model database. The project aims to establish a unified storage solution capable of managing both relational and graph model data. This empowers users to seamlessly leverage standard ANSI SQL alongside openCypher, the designated Graph query language.&lt;/p&gt;

&lt;h2&gt;
  
  
  Graphs
&lt;/h2&gt;

&lt;p&gt;A graph is made up of vertices and edges, and every node and edge has a unique set of attributes associated with it. The fundamental unit of a graph is a vertex, which is independent of all other nodes in the graph. A directed link between two vertices is formed by an edge.&lt;/p&gt;

&lt;p&gt;To create a graph, use the &lt;code&gt;create_graph&lt;/code&gt; function, located in the &lt;code&gt;ag_catalog&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;create_graph(graph_name);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Returns:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;void&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To delete a graph, use the &lt;code&gt;drop_graph&lt;/code&gt; function, located in the &lt;code&gt;ag_catalog&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;drop_graph(graph_name, cascade);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Returns:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;void&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Datatype
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Null&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN NULL&lt;br&gt;
$$) AS (null_result agtype);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integer&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN 1&lt;br&gt;
$$) AS (int_result agtype);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Float&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN 1.0&lt;br&gt;
$$) AS (float_result agtype);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Numeric&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN 1.0::numeric&lt;br&gt;
$$) AS (numeric_result agtype);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bool&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN TRUE&lt;br&gt;
$$) AS (boolean_result agtype);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String&lt;/strong&gt;&lt;br&gt;
SELECT *&lt;br&gt;
FROM cypher('graph_name', $$&lt;br&gt;
    RETURN 'This is a string'&lt;br&gt;
$$) AS (string_result agtype);&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>SQL Syntax (Part 03)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Wed, 13 Sep 2023 18:41:16 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/sql-syntax-part-03-11c9</link>
      <guid>https://dev.to/pawankukreja01/sql-syntax-part-03-11c9</guid>
      <description>&lt;h2&gt;
  
  
  Dollar-Quoted String Constants
&lt;/h2&gt;

&lt;p&gt;A dollar-quoted string that follows a keyword or identifier must be separated from it by whitespace; otherwise the dollar quoting delimiter would be taken as part of the preceding identifier.&lt;/p&gt;

&lt;p&gt;Although dollar quoting is not supported by the SQL standard, it is frequently more practical than using the single quote syntax to construct complex string literals. It is very helpful for encoding string constants inside of other constants, which is frequently required in the definitions of procedural functions. Each backslash in the above example would have to be expressed using single-quote syntax as four backslashes, which would be reduced to two backslashes in the first parsing of the string constant and then to one in the subsequent parsing of the inner string constant during function execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bit-String Constants
&lt;/h2&gt;

&lt;p&gt;Bit-string constants resemble conventional string constants but lack the whitespace between the beginning quotation and the B (in upper or lower case), for example, B'1001'. &lt;/p&gt;

&lt;p&gt;Bitstring constants can only contain the letters 0 and 1.&lt;br&gt;
Bit-string constants can also be written in hexadecimal notation with a leading X (in upper- or lower-case), for example, X'1FF'. Each hexadecimal digit in this notation corresponds to a bit-string constant of four binary digits.&lt;br&gt;
Similar to conventional string constants, both types of bit-string constants can be carried across lines.&lt;br&gt;
A bit-string constant cannot employ dollar quoting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Numeric Constants
&lt;/h2&gt;

&lt;p&gt;If the value of a numeric constant that lacks either a decimal point or an exponent fits within the type integer (32 bits), the constant is originally assumed to be of type integer. If the value falls within the type bigint (64 bits), the constant is assumed to be of type numeric. The initial assumption is that any constants with exponents and/or decimal points are of type numerical.&lt;/p&gt;

&lt;p&gt;The type resolution methods only use the data type that was first allocated to a numeric constant as a starting point. Most of the time, the constant will be automatically forced to the best type based on the situation. When required, you may use casting to compel a numeric value to be interpreted as a certain data type.&lt;/p&gt;

&lt;h2&gt;
  
  
  Special Characters
&lt;/h2&gt;

&lt;p&gt;Other than being an operator, certain non-alphanumeric characters have a specific purpose.&lt;br&gt;
You may get further information on the usage in the section where the relevant syntactic element is discussed. This section is merely included to inform readers of the characters' existence and to summarise their goals.&lt;br&gt;
launching it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In the body of a function definition or a prepared statement, a positional parameter is denoted by a dollar sign ($), followed by digits. The dollar symbol can also be used as an identifier or as a dollar-quoted string constant in other places.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The purpose of brackets (()) is typically to group expressions and establish precedence. Sometimes a certain SQL command has a set syntax that includes brackets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In various syntactical constructions, commas (,) are employed to demarcate the components of a list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An SQL command comes to an end with a semicolon (;). It can only exist within a string constant or quoted identifier in a command; otherwise, it cannot appear elsewhere.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In order to choose "slices" from arrays, use the colon (:). Refer to Section 8.15. The colon is used to prefix variable names in some SQL dialects (such as Embedded SQL).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In some situations, the asterisk (*) is used to indicate every field of a table row or composite value. When used as the argument of an aggregate function, it also has a specific meaning, indicating that the aggregate does not need any explicit parameters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Numeric constants and the names of schema, tables, and columns are separated by a period (.).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>SQL Syntax (Part 02)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Wed, 13 Sep 2023 17:58:20 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/sql-syntax-part-02-1ge1</link>
      <guid>https://dev.to/pawankukreja01/sql-syntax-part-02-1ge1</guid>
      <description>&lt;h2&gt;
  
  
  Constants
&lt;/h2&gt;

&lt;p&gt;In PostgreSQL, there are three categories of implicitly-typed constants: strings, bit strings, and numbers. Additionally, explicit types may be used to specify constants, allowing for a more precise representation and more effective system management. The subsections that follow cover these options.&lt;/p&gt;

&lt;h2&gt;
  
  
  String Constants
&lt;/h2&gt;

&lt;p&gt;An arbitrary string of characters enclosed in single quotes (') is referred to as a string constant in SQL. Write two adjacent single quotes, such as 'Dianne's horse,' to include a single-quote character in a string constant. Keep in mind that this differs from a double-quote character (").&lt;/p&gt;

&lt;h2&gt;
  
  
  String Constants with C-Style Escapes
&lt;/h2&gt;

&lt;p&gt;Additionally, PostgreSQL permits "escape" string constants, an addition to the SQL standard. Just before the first single quotation, write the letter E (in upper- or lowercase), for example, E'foo', to specify an escape string constant. (If you want to continue an escape string constant over many lines, only use E.) A backslash character () starts a backslash escape sequence that looks like C within an escape string.&lt;/p&gt;

&lt;p&gt;You are accountable for ensuring that the byte sequences you generate, particularly when employing the octal or hexadecimal escapes, encode legitimate characters according to the server character set. Use of Unicode escapes or an alternate Unicode escape syntax is a good substitute.&lt;/p&gt;

&lt;h2&gt;
  
  
  String Constants with Unicode Escapes
&lt;/h2&gt;

&lt;p&gt;Another form of escape syntax for strings is also supported by PostgreSQL and allows for the specification of any Unicode characters by code point. Before the starting quotation, without any spaces in between, a Unicode escape string constant begins with U&amp;amp; (an upper- or lower-case letter U followed by an ampersand), for instance, U&amp;amp;'foo'. (Remember that the operator &amp;amp; becomes ambiguous because of this. To get around this issue, use spaces around the operator.) A backslash, a four-digit hexadecimal code point number, or, alternatively, a backslash, a plus sign, and a six-digit hexadecimal code point number can be used to specify Unicode characters in escaped form inside of quotations. &lt;/p&gt;

&lt;p&gt;Although the existence of the 6-digit form technically negates the need for this, it is possible to specify UTF-16 surrogate pairs to assemble characters with code points bigger than U+FFFF using either the 4-digit or 6-digit escape form. Surrogate pairs are concatenated into a single code point rather than being stored separately (directly).&lt;br&gt;
The Unicode code point identified by one of these escape sequences is translated to the actual server encoding if the server's encoding is not UTF-8; if that is not feasible, an error is returned.&lt;/p&gt;

&lt;p&gt;Additionally, the standard_conforming_strings configuration parameter must be enabled in order for the Unicode escape syntax for string constants to function. This is necessary because, in the absence of it, the syntax may mislead clients that interpret SQL statements, which may result in SQL injections and other security problems. This syntax will be denied with an error notice if the argument is set to off.&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>SQL Syntax (Part 01)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Mon, 11 Sep 2023 13:18:29 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/sql-syntax-part-01-2403</link>
      <guid>https://dev.to/pawankukreja01/sql-syntax-part-01-2403</guid>
      <description>&lt;h2&gt;
  
  
  Lexical Structure:
&lt;/h2&gt;

&lt;p&gt;A list of instructions makes up a SQL input sequence. A command is made up of a series of tokens, each of which is followed by a semicolon (";"). A command comes to a conclusion when the input stream is finished. Depending on the syntax of the particular command, some tokens are valid.&lt;/p&gt;

&lt;p&gt;Key words, identifiers, quoted identifiers, literals (or constants), and special character symbols can all be considered tokens. Whitespace (space, tab, newline) is typically used to separate tokens, however it is not required if there is no ambiguity (which is typically only the case if a special character is close to another token type).&lt;/p&gt;

&lt;p&gt;Regarding which tokens identify instructions and which are operands or arguments, the SQL syntax is not particularly consistent. The command name often appears in the first few tokens, thus in the example above, we would typically refer to the commands "SELECT," "UPDATE," and "INSERT." But this kind of INSERT also needs a VALUES to be finished, just as the UPDATE command always needs a SET token to exist in a certain spot. Part VI details each command's explicit syntactic requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identifiers and Key Words
&lt;/h2&gt;

&lt;p&gt;Key words, or words with a predetermined meaning in the SQL language, include tokens like SELECT, UPDATE, or VALUES in the example above. Tokens like MY_TABLE and A serve as identifiers. Depending on the command they are used in, they indicate names of tables, columns, or other database objects. As a result, they are occasionally only referred to as "names". Since identifiers and key words have the same lexical structure, it is impossible to determine whether a token is an identifier or a key word without first understanding the language. In Appendix C, there is a comprehensive list of keywords.&lt;/p&gt;

&lt;p&gt;A letter (a-z, but also letters with diacritical markings and non-Latin characters) or an underscore (_) must come before any SQL identifiers or key words. An identification or key word may contain additional letters, underscores, numerals (0–9), or dollar signs ($). The usage of dollar signs may make applications less portable because they are not permitted in identifiers per the letter of the SQL standard. Identifiers of this type are protected from potential conflict with future additions of the standard since the SQL Standard does not specify a key word that contains numbers or that begins or finishes with an underscore.&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>Advanced Features of PostgreSQL (Part 02)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Mon, 11 Sep 2023 10:46:32 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/advanced-features-of-postgresql-part-02-4fpl</link>
      <guid>https://dev.to/pawankukreja01/advanced-features-of-postgresql-part-02-4fpl</guid>
      <description>&lt;h2&gt;
  
  
  Window Functions
&lt;/h2&gt;

&lt;p&gt;A window function does a computation over a group of table rows that are connected to the current row in some way. This is akin to the kind of calculation that an aggregate function may perform. However, unlike non-window aggregate calls, window functions do not lead to the grouping of rows into a single output row. Instead, the rows continue to be distinct from one another. The window method has access to more rows of the query result than simply the current row in the background.&lt;br&gt;
The OVER clause always follows the window function's name and any arguments in a window function call. This is what sets it apart from a typical function or non-window aggregate syntactically. The window function's exact division of the query's data into subsets for processing depends on the OVER clause. In the OVER clause, the PARTITION BY clause separates the rows into partitions based on the values of the PARTITION BY expression(s). The window function is calculated across the rows that are a part of the same partition as the current row for each row.&lt;br&gt;
You can also control the order in which rows are processed by window functions using ORDER BY within&lt;br&gt;
OVER.&lt;/p&gt;

&lt;p&gt;The idea of window functions also includes the idea that each row has a group of rows within its partition known as its window frame. Some window functions don't affect the entire partition; instead, they simply affect the rows of the window frame. If ORDER BY is not specified, the frame will by default include all rows from the beginning of the partition to the current row, as well as any subsequent rows that are identical to the current row in accordance with the ORDER BY clause. The default frame, when ORDER BY is absent, contains every row in the partition. &lt;/p&gt;

&lt;p&gt;Only the SELECT list and the ORDER BY clause of the query are allowed to employ window functions. Other places, like the GROUP BY, HAVING, and WHERE clauses, restrict them. This is due to the fact that they logically follow the processing of those phrases. In addition, aggregate functions that are not window functions run first. This means that a window function call may include an aggregate function call, but not the other way around.&lt;/p&gt;
&lt;h2&gt;
  
  
  Inheritance:
&lt;/h2&gt;

&lt;p&gt;A notion from object-oriented databases is inheritance. It provides intriguing new opportunities for database design.&lt;br&gt;
Example for Inheritance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE cities (
24
Advanced Features
 name text,
 population real,
 elevation int -- (in ft)
);

CREATE TABLE capitals (
 state char(2) UNIQUE NOT NULL
) INHERITS (cities);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, a column of capitals inherits its parent cities' name, population, and elevation columns. The column name's type, text, is a built-in PostgreSQL type for character strings of varying length. The state column in the capitals table also displays the state's abbreviation. A table in PostgreSQL can derive from zero or more other tables.&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>Advanced Features of PostgreSQL (Part 01)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Mon, 11 Sep 2023 09:52:46 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/advanced-features-of-postgresql-part-01-lnb</link>
      <guid>https://dev.to/pawankukreja01/advanced-features-of-postgresql-part-01-lnb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;We will now discuss some more advanced features of SQL that simplify management and prevent loss or corruption of your data. We will discuss some PostgreSQL extensions aswell.&lt;br&gt;
Some examples from this chapter can also be found in advanced.sql in the tutorial directory. This file also contains some sample data to load.&lt;/p&gt;

&lt;h2&gt;
  
  
  Views:
&lt;/h2&gt;

&lt;p&gt;Suppose the combined listing of weather records and city location&lt;br&gt;
is of particular interest to your application, but you do not want to type the query each time you need&lt;br&gt;
it. You can create a view over the query, which gives a name to the query that you can refer to like an&lt;br&gt;
ordinary table.&lt;/p&gt;

&lt;p&gt;Views allow you to encapsulate the details of the structure of your tables, Making liberal use of views is a key aspect of good SQL database design.&lt;br&gt;
Views can be used in almost any place a real table can be used. Building views upon other views is not uncommon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Foreign Keys:
&lt;/h2&gt;

&lt;p&gt;You want to make sure that no one can insert rows in the weather table that do not have a matching entry in&lt;br&gt;
the cities table. This is called maintaining the referential integrity of your data. In simplistic database&lt;br&gt;
systems this would be implemented (if at all) by first looking at the cities table to check if a matching&lt;br&gt;
record exists, and then inserting or rejecting the new weather records.&lt;/p&gt;

&lt;h2&gt;
  
  
  Transactions:
&lt;/h2&gt;

&lt;p&gt;It is a fundamental concept of all database systems. The essential point of a transaction is that it bundles multiple steps into a single, all-or-nothing operation. The intermediate states between the steps&lt;br&gt;
are not visible to other concurrent transactions, and if some failure occurs that prevents the transaction&lt;br&gt;
from completing, then none of the steps affect the database at all.&lt;br&gt;
When the transaction is done and acknowledged by the database system, it has been permanently recorded and not being lost if ever crash in system. Another important property of transactional databases is closely related to the notion of atomic updates. when multiple transactions are running concurrently, each one should not be able to see the incomplete changes made by others.&lt;br&gt;
In PostgreSQL, a transaction is set up by surrounding the SQL commands of the transaction with BEGIN and COMMIT commands.&lt;br&gt;
If partway through the transaction, we decide we do not want to commit we can issue the command ROLLBACK instead of COMMIT, and all our updates so far will be canceled. &lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>devcommunity</category>
      <category>bitnine</category>
    </item>
    <item>
      <title>The SQL Language (Part-4)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Mon, 11 Sep 2023 08:30:52 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/the-sql-language-part-4-48c3</link>
      <guid>https://dev.to/pawankukreja01/the-sql-language-part-4-48c3</guid>
      <description>&lt;h2&gt;
  
  
  Aggregate Functions:
&lt;/h2&gt;

&lt;p&gt;PostgreSQL Supports aggregate functions, It computes single result from multiple input rows. &lt;br&gt;
Aggregates to compute:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Count&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sum&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;avg&lt;/code&gt;(average)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;max&lt;/code&gt;(maximum)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;min&lt;/code&gt;(minimum)
over the set of rows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is important to understand the interaction between aggregates and SQL's WHERE and HAVING clauses.&lt;br&gt;
The fundamental difference between WHERE and HAVING is this: WHERE selects input rows before groups&lt;br&gt;
and aggregates are computed (thus, it controls which rows go into the aggregate computation), whereas&lt;br&gt;
HAVING selects group rows after groups and aggregates are computed. Thus, the WHERE clause must not&lt;br&gt;
contain aggregate functions; it makes no sense to try to use an aggregate to determine which rows will&lt;br&gt;
be inputs to the aggregates. On the other hand, the HAVING clause always contains aggregate functions.&lt;br&gt;
(Strictly speaking, you are allowed to write a HAVING clause that doesn't use aggregates, but it's seldom&lt;br&gt;
useful. The same condition could be used more efficiently at the WHERE stage.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Updates
&lt;/h2&gt;

&lt;p&gt;You can update existing rows using the UPDATE command. Suppose you discover the temperature readings are all off by 2 degrees after November 28. You can correct the data as follows:&lt;br&gt;
UPDATE weather&lt;br&gt;
 &lt;code&gt;SET temp_hi = temp_hi - 2, temp_lo = temp_lo - 2&lt;br&gt;
 WHERE date &amp;gt; '1994-11-28';&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deletions
&lt;/h2&gt;

&lt;p&gt;Rows can be removed from the table using &lt;code&gt;Delete&lt;/code&gt; command.&lt;br&gt;
If you no longer want any query to execute you can use &lt;code&gt;Delete&lt;/code&gt; command:&lt;br&gt;
&lt;code&gt;DELETE FROM weather WHERE city = 'Hayward';&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The SQL Language (Part-3)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Sun, 13 Aug 2023 22:46:29 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/the-sql-language-part-3-25de</link>
      <guid>https://dev.to/pawankukreja01/the-sql-language-part-3-25de</guid>
      <description>&lt;h2&gt;
  
  
  Joins Between Tables
&lt;/h2&gt;

&lt;p&gt;With the &lt;code&gt;JOIN&lt;/code&gt; function, we can access the multiple table at once or access the same table in such a way that multiple rows of the table are being processed at the same time.&lt;br&gt;
Queries that access multiple tables at one time are called join queries. They combine rows from one table with rows from one table with rows from a second table, with expression specifying which rows are to be paired.&lt;/p&gt;

&lt;p&gt;For Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM weather JOIN cities ON city = name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Output will be:&lt;br&gt;
&lt;code&gt;city | temp_lo | temp_hi | prcp | date | name&lt;br&gt;
 | location&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;San Francisco | 46 | 50 | 0.25 | 1994-11-27 | San Francisco&lt;br&gt;
 | (-194,53)&lt;br&gt;
 San Francisco | 43 | 57 | 0 | 1994-11-29 | San Francisco&lt;br&gt;
 | (-194,53)&lt;br&gt;
(2 rows)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There is no result row for the city of Hayward. This is because there is no matching entry in the &lt;code&gt;cities&lt;/code&gt; table for Hayward, so the join ignores the unmatched rows in the &lt;code&gt;weather&lt;/code&gt; table. We will see shortly how this can be fixed.&lt;/p&gt;

&lt;p&gt;There are two coloumns containing the city name. This is correct because this lists of coloumns from the &lt;code&gt;weather&lt;/code&gt; and &lt;code&gt;cities&lt;/code&gt; tables are concatenated. In practice this is undesirable, through, so you will probably want to list the outputs columns explicitly rather than using.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT city, temp_lo, temp_hi, prcp, date, location
 FROM weather JOIN cities ON city = name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the column all had different names, the parser automatically found which table they belong to. If there were    duplicate columns names in the two tables you would need to qualify the columns names to show which one you meant, as in&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT weather.city, weather.temp_lo, weather.temp_hi,
 weather.prcp, weather.date, cities.location
 FROM weather JOIN cities ON weather.city = cities.name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is widely considered good style to qualify all column names in a join query, so that the query won't fail&lt;br&gt;
if a duplicate column name is later added to one of the tables.&lt;/p&gt;

&lt;p&gt;We will figure out how we can get the Hayward records back in, What we want the query to do is to scan the &lt;code&gt;weather&lt;/code&gt; table and for each row to find the matching &lt;code&gt;cities&lt;/code&gt; row. If no matching found we will use "empty calues"  to substitute for &lt;code&gt;cities&lt;/code&gt; table's columns. This kind of query is called an outer join.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT *
 FROM weather LEFT OUTER JOIN cities ON weather.city = cities.name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;city | temp_lo | temp_hi | prcp | date | name&lt;br&gt;
 | location&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Hayward | 37 | 54 | | 1994-11-29 |&lt;br&gt;
 |&lt;br&gt;
 San Francisco | 46 | 50 | 0.25 | 1994-11-27 | San Francisco&lt;br&gt;
 | (-194,53)&lt;br&gt;
San Francisco | 43 | 57 | 0 | 1994-11-29 | San Francisco&lt;br&gt;
 | (-194,53)&lt;br&gt;
(3 rows)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is called left outer join because the table mentioned on teh left of the join operator will have each of its rows in the output at least once. &lt;/p&gt;

&lt;p&gt;There are also right outer joins and full outer joins. &lt;/p&gt;

&lt;p&gt;We can also join a table against itself. This is called self join. As an example, suppose we wish to find all the weather records that are in the temperature range of other weather records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT w1.city, w1.temp_lo AS low, w1.temp_hi AS high,
 w2.city, w2.temp_lo AS low, w2.temp_hi AS high
 FROM weather w1 JOIN weather w2
 ON w1.temp_lo &amp;lt; w2.temp_lo AND w1.temp_hi &amp;gt; w2.temp_hi;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;city | low | high | city | low | high&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;San Francisco | 43 | 57 | San Francisco | 46 | 50&lt;br&gt;
 Hayward | 37 | 54 | San Francisco | 46 | 50&lt;br&gt;
(2 rows)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can relable the weather table as w1 and w2 to be able to distinguish the left and right side of join.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT *
 FROM weather w JOIN cities c ON w.city = c.name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>bitnine</category>
      <category>postgres</category>
      <category>apacheage</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>The SQL Language (Part-2)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Sun, 13 Aug 2023 21:52:52 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/the-sql-language-part-2-nfb</link>
      <guid>https://dev.to/pawankukreja01/the-sql-language-part-2-nfb</guid>
      <description>

&lt;h2&gt;
  
  
  Querying a Table
&lt;/h2&gt;

&lt;p&gt;A SQL &lt;code&gt;SELECT&lt;/code&gt; statement is used to retrieve the data from the table. Like to retrieve all the rows of table &lt;code&gt;weather&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;SELECT * FROM weather;

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

&lt;/div&gt;



&lt;p&gt;Here * showed the all columns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT city, temp_lo, temp_hi, prcp, date FROM weather;

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

&lt;/div&gt;



&lt;p&gt;The Output should be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;city | temp_lo | temp_hi | prcp | date&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;San Francisco | 46 | 50 | 0.25 | 1994-11-27&lt;br&gt;
 San Francisco | 43 | 57 | 0 | 1994-11-29&lt;br&gt;
 Hayward | 37 | 54 | | 1994-11-29&lt;br&gt;
(3 rows)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can write expression, not just simple coulumn references, in the select list, you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should give:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;city | temp_avg | date&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;San Francisco | 48 | 1994-11-27&lt;br&gt;
 San Francisco | 50 | 1994-11-29&lt;br&gt;
 Hayward | 45 | 1994-11-29&lt;br&gt;
(3 rows)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A query can be “qualified” by adding a WHERE clause that specifies which rows are wanted. The WHERE&lt;br&gt;
clause contains a Boolean expression.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM weather
 WHERE city = 'San Francisco' AND prcp &amp;gt; 0.0;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will show:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;city | temp_lo | temp_hi | prcp | date&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;San Francisco | 46 | 50 | 0.25 | 1994-11-27&lt;br&gt;
(1 row)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can sort the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM weather
 ORDER BY city;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;city | temp_lo | temp_hi | prcp | date&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Hayward | 37 | 54 | | 1994-11-29&lt;br&gt;
 San Francisco | 43 | 57 | 0 | 1994-11-29&lt;br&gt;
 San Francisco | 46 | 50 | 0.25 | 1994-11-27&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It may not give full results:&lt;/p&gt;

&lt;p&gt;Try this command to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM weather
 ORDER BY city, temp_lo;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can request duplicate rows be removed from the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT DISTINCT city
 FROM weather;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will show &lt;/p&gt;

&lt;p&gt;&lt;code&gt;city&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Hayward&lt;br&gt;
 San Francisco&lt;br&gt;
(2 rows)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;DISTINCT&lt;/code&gt; and &lt;code&gt;ORDER BY&lt;/code&gt;, together for correct order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT DISTINCT city
 FROM weather
 ORDER BY city;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>bitnine</category>
      <category>postgres</category>
      <category>apacheage</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>The SQL Language (Part-1)</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Sun, 13 Aug 2023 12:09:57 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/the-sql-language-part-1-3i92</link>
      <guid>https://dev.to/pawankukreja01/the-sql-language-part-1-3i92</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This chapter provides an overview of how to use SQL to perform simple operations. This tutorial is only intended to give you an introduction and is in no way a complete tutorial on SQL. &lt;br&gt;
In the following example we assume that you have created a database named mydb as described in the previous chapter and have been able to start psql &lt;/p&gt;

&lt;p&gt;Examples can also be found in the PostgreSQL source distribution in the directory src/tutorial/.&lt;br&gt;
To use those files, first change to that directory and run make:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This creates the scripts and compiles the C files containing user-defined functions and types. Then to start to tutorial do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;psql -s mydb
&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;mydb=&amp;gt; \i basics.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This \i command reads in commands from the specified file. psql's -s option puts you in single step mode which pauses before sending each statement to the server. This commands used in this section are in the file basics.sql.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concepts
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is a relational database management system(RDBMS), that means it is a system for managing data stored in relations. Relation is essentially a mathematical term for table. The notion of storing data in tables is so common place today that it might seem inherently obvious but there are a number of other ways of organising database.&lt;/p&gt;

&lt;p&gt;Each table is a named collection of rows. Each row of a given table has the same set of named columns and each colum is of a specific datatype. Where as columns have a fixed order in each row, it is important to remember that SQL does not guarntee the order of the rows within the table in any way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a New Table
&lt;/h2&gt;

&lt;p&gt;you can create a table by specifying the table name along with all column names and their types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create table weather (
city varchar(80),
 temp_lo int, -- low temperature
 temp_hi int, -- high temperature
 prcp real, -- precipitation
 date date
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can enter this into psql with the line breaks. psql will recognise that the command is not terminated until the semicolon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Populating a Table With Rows
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;INSERT&lt;/code&gt; statement is used to populate a table with rows:&lt;/p&gt;

&lt;p&gt;INSERT INTO weather VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27');&lt;br&gt;
All the data types use rather obvious input formats. Constants that are not simple numeric values usually must be surrounded by single quotes, as in the example. The datatype is actually quite flexible in what it accepts, but for this tutorial we will stick to the unambiguous formate shown here.&lt;/p&gt;

&lt;p&gt;The point type requires a coordinate pair as input as shown here&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO cities VALUES ('San Francisco', '(-194.0, 53.0)');

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

&lt;/div&gt;



&lt;p&gt;This syntax used so far requires you to remember the order of the columns. As alternative syntax allows you to list the columns explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO weather (city, temp_lo, temp_hi, prcp, date)
 VALUES ('San Francisco', 43, 57, 0.0, '1994-11-29');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can list the columns in a different order if you wish or even omit some columns, e.g., if the precipitation&lt;br&gt;
is unknown:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO weather (date, city, temp_hi, temp_lo)
 VALUES ('1994-11-29', 'Hayward', 54, 37);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter all the commands shown above so you have some data to work with in the following sections.&lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;COPY&lt;/code&gt; to load large amounts of data from flat-text files. This is usually faster because the &lt;code&gt;COPY&lt;/code&gt; command is optimised for this application while allowing less flexibility that &lt;code&gt;INSERT&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;COPY weather FROM '/home/user/weather.txt';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where file name for the source file must be available on the machine running the backend process.&lt;/p&gt;

</description>
      <category>bitnine</category>
      <category>postgres</category>
      <category>apacheage</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>Architecture of PostgreSQL.</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Sun, 13 Aug 2023 11:09:02 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/architecture-of-postgresql-8c3</link>
      <guid>https://dev.to/pawankukreja01/architecture-of-postgresql-8c3</guid>
      <description>&lt;h2&gt;
  
  
  Architecture Fundamentals
&lt;/h2&gt;

&lt;p&gt;In database jargon, PostgreSQL uses a client/server model. A PostgreSQL session consists of the following cooperating processes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A server process, which manages the database files, accepts connections to the database from client applications, and performs database actions on behalf of the clients. The database server program is called postgres. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The user's client application that wants to perform database operations. Client applications can be very diverse in nature: a client could be a text-oriented tool, a graphical application, a web server that accesses the database to display web pages, or a specialized database maintenance tool. Some client applications are supplied with the PostgreSQL distribution; most are developed by users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As is typical of client/server applications, the client and the server can be on different hosts. In that case&lt;br&gt;
they communicate over a TCP/IP network connection. You should keep this in mind, because the files that can be accessed on a client machine might not be accessible  on the database server machine.&lt;/p&gt;

&lt;p&gt;The PostgreSQL server can handle multiple concurrent connections from clients. To achieve this it starts&lt;br&gt;
(“forks”) a new process for each connection. From that point on, the client and the new server process&lt;br&gt;
communicate without intervention by the original postgres process. Thus, the supervisor server process&lt;br&gt;
is always running, waiting for client connections, whereas client and associated server processes come and&lt;br&gt;
go.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a Database
&lt;/h2&gt;

&lt;p&gt;The first test to see whether you can access the database server is to try to create a database. A running&lt;br&gt;
PostgreSQL server can manage many databases.&lt;/p&gt;

&lt;p&gt;To create a new database, in this example named mydb, you use the following command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If this produces no response then this step was successful and you can skip over the remainder of this&lt;br&gt;
section.&lt;/p&gt;

&lt;p&gt;If you see a message similar to:&lt;br&gt;
&lt;code&gt;createdb: command not found&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then PostgreSQL was not installed properly. Either it was not installed at all or your shell's search path&lt;br&gt;
was not set to include it. Try calling the command with an absolute path instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/local/pgsql/bin/createdb mydb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The path at your site might be different. Contact your site administrator or check the installation instructions to correct the situation.&lt;/p&gt;

&lt;p&gt;Another response could be this:&lt;br&gt;
&lt;code&gt;createdb: error: connection to server on socket "/tmp/.s.PGSQL.5432"&lt;br&gt;
 failed: No such file or directory&lt;br&gt;
 Is the server running locally and accepting connections on&lt;br&gt;
 that socket?&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This means that the server was not started, or it is not listening where createdb expects to contact it.&lt;br&gt;
Again, check the installation instructions or consult the administrator.&lt;/p&gt;

&lt;p&gt;Another response could be this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;createdb: error: connection to server on socket "/tmp/.s.PGSQL.5432"&lt;br&gt;
 failed: FATAL: role "pawan" does not exist&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where your own login name mentioned. This will happen if the administrator has not created a PostgreSQL user account for you.&lt;/p&gt;

&lt;p&gt;If you have a user account but it does not have the privileges required to create a database, you will see&lt;br&gt;
the following:&lt;br&gt;
&lt;code&gt;createdb: error: database creation failed: ERROR: permission denied&lt;br&gt;
 to create database&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If PostgreSQL refuses to create databases for&lt;br&gt;
you then the site administrator needs to grant you permission to create databases.&lt;/p&gt;

&lt;p&gt;You can also create databases with other names. PostgreSQL allows you to create any number of databases&lt;br&gt;
at a given site.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If you do not want to use your database anymore you can remove it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dropdb mydb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>postgres</category>
      <category>apacheage</category>
      <category>bitnine</category>
      <category>devcommunity</category>
    </item>
    <item>
      <title>Brief Introduction to PostgreSQL</title>
      <dc:creator>Pawan Kukreja</dc:creator>
      <pubDate>Sun, 13 Aug 2023 10:27:53 +0000</pubDate>
      <link>https://dev.to/pawankukreja01/brief-introduction-to-postgresql-35if</link>
      <guid>https://dev.to/pawankukreja01/brief-introduction-to-postgresql-35if</guid>
      <description>&lt;h2&gt;
  
  
  What is PostgreSQL
&lt;/h2&gt;

&lt;p&gt;It is an object-relational database management system based on Postgres Version 4.2 developed by University of California at Barkeley Computer Science Department.&lt;/p&gt;

&lt;p&gt;It support large part of the SQL standard and offers many modern features and It is an open source.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex Queries&lt;/li&gt;
&lt;li&gt;Foreign Keys&lt;/li&gt;
&lt;li&gt;Triggers&lt;/li&gt;
&lt;li&gt;Updatable Views&lt;/li&gt;
&lt;li&gt;Transaction integrity&lt;/li&gt;
&lt;li&gt;Multiversion Concurrency Control&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PostgreSQL can be extended by the user in many way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data types&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Operators&lt;/li&gt;
&lt;li&gt;Aggregate Functions&lt;/li&gt;
&lt;li&gt;Index Methods&lt;/li&gt;
&lt;li&gt;Procedural Languges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PostgreSQL can be used modified and distributed by anyone free of charge for any purpose, be it private commercial and academic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Brief History of PostgreSQL
&lt;/h2&gt;

&lt;p&gt;PostgreSQL previously called The object-relational database management system derived from Postgres package written in University of California at Berkeley. Now PostgreSQL is now the most advanced open-sources database available anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Postgres95&lt;/strong&gt;&lt;br&gt;
In 1994, Andrew Yu and Jolly Chen added an SQL Language interpreter to Postgres. Under a New name Postgres95 and subsequently released to the web to find its own way in the world as an open-source descendant of the original Postgres Berkley code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;&lt;br&gt;
In 1996 name was changed from Postgres95 to PostgreSQL to reflect the relationship between the original Postgres and the more recent versions with SQL capabilities. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Convention&lt;/strong&gt;&lt;br&gt;
The following conventions are used in the synopsis of a command.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brackets "[ and ]" which Indicates optional parts.&lt;/li&gt;
&lt;li&gt;Braces "{ and }" and vertical lines "|" indicate that you must choose one alternative. &lt;/li&gt;
&lt;li&gt;Dots "..." indicated that the preceding element can be repeated.
And all other symbols including parentheses should be taken literally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SQL commands are preceded by the prompt =&amp;gt;, and shell commands are preceded by the prompt $. Normally, prompts are not shown through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Reporting Guidlines
&lt;/h2&gt;

&lt;p&gt;Big report plays an important role in making PostgreSQL more reliable because even the utmost care cannot guarantee that every part of PostgreSQL will work on every platform under every circumstances.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identifying Bugs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A program terminates with a fatal signal or an operating system error message that would point to a problem in the program.&lt;/li&gt;
&lt;li&gt;A program produces the wrong output for any given input&lt;/li&gt;
&lt;li&gt;A program refuses to accept the valid input.&lt;/li&gt;
&lt;li&gt;A program accepts invalid input without a notice or error message&lt;/li&gt;
&lt;li&gt;PostgreSQL fails to compile build or install according to the instructions on supported platforms&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bitnine</category>
      <category>apacheage</category>
      <category>postgres</category>
      <category>devcommunity</category>
    </item>
  </channel>
</rss>
