- Add deserialization support for the
tsvector
type, used by the PostgreSQL full text search functionality. They will now be parsed into a list ofpg-ts
structures.
-
Add serialization support for the PostgreSQL
date
type. -
Add serialization support for the
vector
type used by the pgvector extension.
-
Integer datatypes are now parsed with
cl-parse-integer
instead ofstring-to-number
to provide error detection. -
Add serialization support for the PostgreSQL
timestamp
,timestamptz
anddatetime
types. -
New feature: logging of SQL queries sent to PostgreSQL on a per-connection basis. Call function
pg-enable-query-log
on a connection object, and SQL sent to the backend bypg-exec
andpg-exec-prepared
will be logged to a buffer named*PostgreSQL query log*
(made unique if multiple pg-el connections have been made). The name of the buffer is given by accessor functionpgcon-query-log
on the connection object. -
New variable
pg-connect-timeout
to set a timeout (in seconds) for attempts to connect to PostgreSQL over the network (does not apply to Unix socket connections).
-
Add serialization support for the
hstore
datatype from Emacs Lisp hashtables. -
Add support for schema-qualified names for tables and roles. These are names of the form
public.tablename
orusername.tablename
(see the PostgreSQL documentation forCREATE SCHEMA
). “Ordinary” table names in thepublic
schema can be specified as a simple string. Table names with a different schema are represented bypg-qualified-name
objects (these are cl-defstruct objects). Functions that take a table name as an argument (such aspg-columns
accept either a normal string or apg-qualified-name
object. Functions that return table names, in particularpg-tables
, will return strings for tables in the normalpublic
schema, andpg-qualified-name
objects otherwise. -
Fix bug in the parsing of
pgcon-server-version-major
.
-
Add for receiving data in Emacs using the COPY protocol, as a complement to the existing functionality which uses the COPY protocol to send data from Emacs to PostgreSQL. This allows you to dump a PostgreSQL table or query result in TSV or CSV format into an Emacs buffer. See function
pg-copy-to-buffer
. -
Preliminary implementation of connection to PostgreSQL via a connection string of the form
host=localhost port=5432 dbname=mydb
(see functionpg-connect/string
). -
Preliminary implementation of connection to PostgreSQL via a connection URI of the form
postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp&ssl=true
(see functionpg-connect/uri
). -
Add serialization function for the
bpchar
type. -
If the environment variable
PGAPPNAME
is set, it will override the default value of variablepg-application-name
.
-
New function
pg-table-owner
. -
New functions
pg-table-comment
and(setf pg-table-comment)
. -
New function
pg-column-default
which returns the default value for a column.
- New functions
pg-escape-identifier
andpg-escape-literal
to escape an SQL identifier (table, column or function name) or a string in an SQL command. These functions are similar respectively to libpq functionsPQescapeIdentifier
andPQescapeLiteral
. These functions help to prevent SQL injection attacks. However, you should use prepared statements (elisp functionpg-exec-prepared
) instead of these functions whenever possible.
-
Improvements to the internal parsing functionality to use a hashtable instead of an alist to look up parsing functions (performance should be improved).
-
Improved support for user-defined parsing for custom PostgreSQL types (see the function
pg-register-parser
). -
Add support for the pgvector extension for vector embeddings.
-
API change for
pg-fetch
when using prepared statements with a suspended portal. The second argument is a pgresult structure, rather than the portal name. This changes improves performance by making it possible to avoid redundant DescribeRow messages. -
The extended query flow used by
pg-exec-prepared
has been modified to be more asynchronous to improve performance: instead of waiting for a response after the Prepare and Bind phases, only wait a single time after the Execute phase.
-
Add support for the extended query syntax, which helps to avoid the risk of SQL injection attacks. See function
pg-exec-prepared
. This also makes it easier to fetch partial results from a query that returns a large number of rows. -
Fix parsing of PostgreSQL
CHAR
type to an Emacs character instead of a string of length 1. -
Various internal functions and variables renamed with the
pg--
prefix instead ofpg-
.
-
Add function
pg-add-notification-handler
to add a function to the list of handlers forNotificationResponse
messages from PostgreSQL. A handler takes two arguments, the channel and the payload, which correspond to SQL-levelNOTIFY channel, 'payload'
. -
Add support for asynchronous processing of messages from PostgreSQL, in particular for use of LISTEN/NOTIFY. This allows PostgreSQL and Emacs to be used in a publish-subscribe pattern which decouples event publication from the number and the speed of event processing nodes. See the notification-publisher.el and notification-subscriber.el tests for a basic example.
- Fix the implementation of
pg-tables
andpg-columns
to use the information schema instead of historical alternative SQL queries.
- Preliminary support for the COPY protocol. See function
pg-copy-from-buffer
.
- The backend can send NoticeResponse messages during connection startup, for example indicating a collation version mismatch between your database and the operating system.
- Declare some autoloaded functions to avoid warning from the bytecode compiler.
- Wait for further data from the network in
pg-read-chars
if the process buffer doesn't yet contain the necessary data (fix from swilsons).
- Add support for parsing the
BIT
andVARBIT
datatypes. - Add support for parsing ARRAY datatypes.
- Add support for parsing RANGE datatypes (integer and numerical).
- Add support for parsing HSTORE datatypes (see function
pg-hstore-setup
to prepare the database connection for use of the HSTORE datatype). - Add function
pg-cancel
to request cancellation of the command currently being processed by the backend.
- Fix bug in handling of DataRow messages when zero columns returned by query.
- Add support for connecting to PostgreSQL over a local Unix socket.
- Add support for parsing the
BYTEA
datatype (binary strings). We assume that the PostgreSQL configuration variablebytea_output
is set tohex
(the default setting). - Add support for parsing the
JSON
datatype, into the Emacs JSON representation. - Add support for parsing the
JSONB
datatype, into the Emacs JSON representation. - Add support for handling ParameterStatus messages sent by the backend (see variable
pg-parameter-change-functions
). - Add support for handling NOTICE messages sent by the backend (see variable
pg-handle-notice-functions
). - New pg-error and pg-protocol-error error types. All errors raised by the library will be a subclass of pg-error.
- Fix bug in parsing of NULL column values in DataRow messages.
- Fix handling of encoding of attribute column names.
- Fix handling of PostgreSQL error messages (correctly resync with the backend).
- Support for encrypted (TLS) connections with PostgreSQL
- Native support for PBKDF2 algorithm to allow SCRAM-SHA-256 authentication without the external nettle-pbkdf2 application
- Implement multibyte encoding and decoding for pg-exec requests
- Send application_name to PostgreSQL backend to improve observability
- Fix handling of NotificationResponse messages
- Improve test coverage
- Include continuous integration tests on Windows and MacOS (GitHub actions)
- This version distributed via MELPA
- Fix MD5 authentication
- Use client-encoding to decode PostgreSQL error messages
- Improve GitHub Actions continuous integration workflow
- Moved from cl library to cl-lib
- pg: prefix for symbol names changed to pg- (Emacs Lisp coding conventions)
- Implemented version 3.0 of the PostgreSQL wire protocol
- Implemented SCRAM-SHA-256 authentication
- Implemented MD5 authentication
- Distributed via github repository
This version was distributed from http://purl.org/net/emarsden/home/downloads/ and via the EmacsWiki.