Home » Tag Archives: PostgreSQL

Tag Archives: PostgreSQL

More on Spooling Queries and Results in psql

postgresql-logo

In the recent blog post SPOOLing Queries with Results in psql, I looked briefly at some PostgreSQL database psql meta-commands and options that can be used to emulate Oracle database‘s SQL*Plus spooling behavior. In that post, I wrote, “I have not been able to figure out a way to … have both the query and its results written to the ...

Read More »

AutoCommit in PostgreSQL’s psql

postgresql-logo

One potential surprise for someone familiar with Oracle database‘s SQL*Plus when being introduced to PostgreSQL database‘s psql may be psql‘s default enabling of autocommit. This post provides an overview of psql’s handling of autocommit and some related nuances. By default, Oracle’s SQL*Plus command-line tool does not automatically commit DML statements and the operator must explicitly commit these statements as part ...

Read More »

Does PostgreSQL Have an ORA-01795-like Limit?

postgresql-logo

The Oracle database requires that no more than 1000 entries be used in a SQL IN portion of a WHERE clause and will throw an ORA-01795 error if that number is exceeded. If a value needs to be compared to more than 1000 values, approaches other than use of IN must be applied. I wondered if this limitation applies to ...

Read More »

NoSQL vs. SQL: Choosing a Data Management Solution

software-development-2-logo

Table Of Contents 1. Introduction 2. Distributed systems: the CAP theorem 3. Relational data stores 3.1. MySQL / MariaDB 3.2. PostgreSQL 3.3. Others 4. Why NoSQL? 5. Key/Value data stores 5.1. DynamoDB 5.2. Memcached 5.3. Redis 5.4. Riak 5.5. Aerospike 5.6. FoundationDB 6. Columnar data stores 6.1. Accumulo 6.2. Cassandra 6.3. HBase 7. Graph data stores 7.1. Neo4J 7.2. Titan ...

Read More »

Listen to notifications from Postgresql with Scala

postgresql-logo

In the past I’ve written a couple of articles (Building a REST service in Scala with Akka HTTP, Akka Streams and reactive mongo and ReactiveMongo with Akka, Scala and websockets) which used MongoDB to push updates directly from the database to a Scala application. This is a very nice feature if you just want to subscribe your application to a ...

Read More »

Downsides of Mixed Identifiers When Porting Between Oracle and PostgreSQL Databases

postgresql-logo

Both the Oracle database and the PostgreSQL database use the presence or absence of double quotes to indicate case sensitive or case insensitive identifiers. Each of these databases allows identifiers to be named without quotes (generally case insensitive) or with double quotes (case sensitive). This blog post discusses some of the potential negative consequences of mixing quoted (or delimited) identifiers ...

Read More »

Passing Arrays to a PostgreSQL PL/pgSQL Function

postgresql-logo

It can be handy to pass a collection of strings to a PL/pgSQL stored function via a PostgreSQL array. This is generally a very easy thing to accomplish, but this post demonstrates a couple of nuances to be aware of when passing an array to a PL/pgSQL function from JDBC or psql. The next code listing is for a contrived ...

Read More »

Setting PostgreSQL psql Variable Based Upon Query Result

postgresql-logo

When using PostgreSQL‘s psql command-line tool to interact with a PostgreSQL database via operator interaction or script, it is not uncommon to want to set psql variables based on the results of a particular query. While PostgreSQL’s procedural language PL/pgSQL supports approaches such as SELECT INTO and assignment (:=) to set PL/pgSQL variables based on a query result, these approaches ...

Read More »

Procedure-Like Functions in PostgreSQL PL/pgSQL

postgresql-logo

PostgreSQL does not support stored procedures in the sense that a database such as Oracle does, but it does support stored functions. In this post, I look at a few tactics that can make the use of a stored function in PostgreSQL (stored function and its calling code both written in PL/pgSQL) feel like using a stored procedure. These simple ...

Read More »

Installing PostgreSQL PL/Java as a PostgreSQL Extension

postgresql-logo

In 2011 I wrote a series of articles on PostgreSQL PL/Java. The basic information is still solid but there is a now a much easier way to install PL/Java from source. This also eliminates the need to depend on third parties to create packages. These notes will be fairly brief since I assume my readers are already familiar with git ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns