0% found this document useful (0 votes)
5K views65 pages

Mastering PostgreSQL 15 Advanced Techniques To Build and Manage Scalable Reliable and Fault Tolerant Database Applications 5th Edition Hans-Jurgen Schonig 2024 Scribd Download

fault

Uploaded by

ihrieamodoev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5K views65 pages

Mastering PostgreSQL 15 Advanced Techniques To Build and Manage Scalable Reliable and Fault Tolerant Database Applications 5th Edition Hans-Jurgen Schonig 2024 Scribd Download

fault

Uploaded by

ihrieamodoev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Mastering PostgreSQL 15 Advanced techniques to


build and manage scalable reliable and fault
tolerant database applications 5th Edition Hans-
Jurgen Schonig
https://textbookfull.com/product/mastering-
postgresql-15-advanced-techniques-to-build-and-manage-
scalable-reliable-and-fault-tolerant-database-
applications-5th-edition-hans-jurgen-schonig/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

MASTERING JAVASCRIPT DESIGN PATTERNS create scalable and


reliable applications with advanced Javascript design
patterns using reliable code 3rd Edition Tomas Corral
Cosas
https://textbookfull.com/product/mastering-javascript-design-patterns-
create-scalable-and-reliable-applications-with-advanced-javascript-
design-patterns-using-reliable-code-3rd-edition-tomas-corral-cosas/
textboxfull.com

Advanced methods for fault diagnosis and fault-tolerant


control Steven X. Ding

https://textbookfull.com/product/advanced-methods-for-fault-diagnosis-
and-fault-tolerant-control-steven-x-ding/

textboxfull.com

Introducing Istio Service Mesh for Microservices Build and


Deploy Resilient Fault Tolerant Cloud Native Applications
2nd Edition Burr Sutter
https://textbookfull.com/product/introducing-istio-service-mesh-for-
microservices-build-and-deploy-resilient-fault-tolerant-cloud-native-
applications-2nd-edition-burr-sutter/
textboxfull.com

Advances in Gain-Scheduling and Fault Tolerant Control


Techniques 1st Edition Damiano Rotondo (Auth.)

https://textbookfull.com/product/advances-in-gain-scheduling-and-
fault-tolerant-control-techniques-1st-edition-damiano-rotondo-auth/

textboxfull.com
PostgreSQL Up and Running A Practical Guide to the
Advanced Open Source Database Regina O. Obe

https://textbookfull.com/product/postgresql-up-and-running-a-
practical-guide-to-the-advanced-open-source-database-regina-o-obe/

textboxfull.com

Robust Integration of Model-Based Fault Estimation and


Fault-Tolerant Control Jianglin Lan

https://textbookfull.com/product/robust-integration-of-model-based-
fault-estimation-and-fault-tolerant-control-jianglin-lan/

textboxfull.com

PostgreSQL Up and Running A Practical Guide to the


Advanced Open Source Database 3rd Edition Regina O. Obe

https://textbookfull.com/product/postgresql-up-and-running-a-
practical-guide-to-the-advanced-open-source-database-3rd-edition-
regina-o-obe/
textboxfull.com

PostgreSQL for data architects discover how to design


develop and maintain your database application effectively
with PostgreSQL Maymala
https://textbookfull.com/product/postgresql-for-data-architects-
discover-how-to-design-develop-and-maintain-your-database-application-
effectively-with-postgresql-maymala/
textboxfull.com

Robust and Fault Tolerant Control Neural Network Based


Solutions Krzysztof Patan

https://textbookfull.com/product/robust-and-fault-tolerant-control-
neural-network-based-solutions-krzysztof-patan/

textboxfull.com
Mastering PostgreSQL 15

Advanced techniques to build and manage scalable, reliable,


and fault-tolerant database applications

Hans-Jürgen Schönig

BIRMINGHAM—MUMBAI
Mastering PostgreSQL 15
Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, without the prior written permission of the publisher, except in the case of brief quotations
embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.
However, the information contained in this book is sold without warranty, either express or implied. Neither the
author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged
to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the
accuracy of this information.

Group Product Manager: Reshma Raman


Publishing Product Manager: Devika Battike
Senior Editor: Nazia Shaikh
Content Development Editor: Priyanka Soam
Technical Editor: Sweety Pagaria
Copy Editor: Safis Editing
Project Coordinator: Farheen Fathima
Proofreader: Safis Editing
Indexer: Sejal Dsilva
Production Designer: Vijay Kamble
Marketing Coordinator: Nivedita Singh

First published: Jan 2018


Second edition: Oct 2018
Third edition: Nov 2019
Fourth edition: Nov 2020
Fifth published: Jan 2023

Production reference: 1270123

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-80324-834-9
www.packtpub.com
Contributors

About the author


Hans-Jürgen Schönig has 20 years’ experience with PostgreSQL. He is the CEO of a PostgreSQL
consulting and support company called CYBERTEC PostgreSQL International GmbH. It has successfully
served countless customers around the globe. Before founding CYBERTEC PostgreSQL International
GmbH in 2000, he worked as a database developer at a private research company that focused on the
Austrian labor market, where he primarily worked on data mining and forecast models. He has also
written several books about PostgreSQL.
About the reviewers
Burhan Akbulut is the co-founder of PostgresTech. It is a company that provides PostgreSQL consultancy
and support to start-ups and enterprise companies. Burhan Akbulut started his career as a PostgreSQL
consultant at CookSoft, a well-known PostgreSQL consulting firm founded by Şahap Aşçı, where he
provided consultancy and support to many international customers. Before founding PostgresTech,
he worked at Vodafone as an open source database senior specialist responsible for all PostgreSQL
databases. He has especially focused on database management with IaC, management of cloud databases,
and migration from other databases to PostgreSQL during his career.

I would like to thank my colleague Şeyma Mintaş who helped me review the book.

Marcelo Diaz is a software engineer with more than 15 years of experience, with a special focus on
PostgreSQL. He is passionate about open source software and has promoted its application in critical
and high-demand environments, working as a software developer and consultant for both private and
public companies. He currently works very happily at Cybertec and as a technical reviewer for Packt
Publishing. He enjoys spending his leisure time with his daughter, Malvina, and his wife, Romina.
He also likes playing football.

Dinesh Kumar Chemuduru works as a principal architect (OSS) at Tessell Inc. He has been working
with PostgreSQL since 2011, and he also worked as a consultant at AWS. He is also an author and
contributor to a few popular open source solutions. He co-authored PostgreSQL High Performance
Cookbook 9.6, which was released in 2016. He loves to code in Dart, Go, Angular, and C++ and loves
to deploy them in Kubernetes.

Thanks and love to my wife, Manoja Reddy, and my kids, Yashvi and Isha.
Table of Contents

Prefacexiii

1
PostgreSQL 15 Overview 1
Making use of DBA-related features 1 Working around NULL and UNIQUE 9
Removing support for old pg_dump 1 Adding the MERGE command
Deprecating Python 2 2 to PostgreSQL 10
Fixing the public schema 2 Using performance-related features 11
Adding pre-defined roles 2 Adding multiple compression algorithms 11
Adding permissions to variables 3 Handling parallel queries more efficiently 12
Improving pg_stat_statements 3 Improved statistics handling 12
New wait events 4 Prefetching during WAL recovery 12
Adding logging functionality 4
Additional replication features 12
Understanding developer-related Two-phase commit for logical decoding 12
features7 Adding row and column filtering 13
Security invoker views 7 Improving ALTER SUBSCRIPTION 13
ICU locales 7 Supporting compressed base backups 14
Better numeric 8 Introducing archiving libraries 15
Handling ON DELETE 9
Summary15

2
Understanding Transactions and Locking 17
Working with PostgreSQL Transactional DDLs 23
transactions17 Understanding basic locking 24
Handling errors inside a transaction 21
Avoiding typical mistakes and explicit locking 26
Making use of SAVEPOINT 22
vi Table of Contents

Making use of FOR SHARE Optimizing storage and


and FOR UPDATE 30 managing cleanup 39
Understanding transaction Configuring VACUUM and autovacuum 41
isolation levels 33 Watching VACUUM at work 43
Considering serializable snapshot isolation Limiting transactions by making
transactions35 use of snapshot too old 47
Making use of more VACUUM features 47
Observing deadlocks and
similar issues 36 Summary48
Utilizing advisory locks 38 Questions48

3
Making Use of Indexes 49
Understanding simple queries Understanding PostgreSQL
and the cost model 50 index types 80
Making use of EXPLAIN 51 Hash indexes 81
Digging into the PostgreSQL cost model 53 GiST indexes 81
Deploying simple indexes 55 GIN indexes 84
Making use of sorted output 56 SP-GiST indexes 85
Using bitmap scans effectively 59 BRINs86
Using indexes in an intelligent way 59 Adding additional indexes 88
Understanding index de-duplication 62
Achieving better answers
Improving speed using with fuzzy searching 90
clustered tables 62 Taking advantage of pg_trgm 90
Clustering tables 66 Speeding up LIKE queries 92
Making use of index-only scans 67 Handling regular expressions 93

Understanding additional Understanding full-text searches 94


B-tree features 68 Comparing strings 95
Combined indexes 68 Defining GIN indexes 95
Adding functional indexes 69 Debugging your search 96
Reducing space consumption 70 Gathering word statistics 98
Adding data while indexing 72 Taking advantage of exclusion operators 98

Introducing operator classes 72 Summary99


Creating an operator class for a B-tree 74 Questions100
Table of Contents vii

4
Handling Advanced SQL 101
Supporting range types 102 Using sliding windows 121
Querying ranges efficiently 103 Abstracting window clauses 128
Handling multirange types 105 Using on-board windowing functions 129
When to use range types 107 Writing your own aggregates 137
Introducing grouping sets 107 Creating simple aggregates 137
Loading some sample data 108 Adding support for parallel queries 141
Applying grouping sets 109 Improving efficiency 142
Investigating performance 111 Writing hypothetical aggregates 144
Combining grouping sets with Handling recursions 146
the FILTER clause 113
UNION versus UNION ALL 147
Making use of ordered sets 114 Inspecting a practical example 148
Understanding hypothetical Working with JSON and JSONB 150
aggregates116
Displaying and creating JSON documents 150
Utilizing windowing functions Turning JSON documents into rows 152
and analytics 117 Accessing a JSON document 153
Partitioning data 118
Ordering data inside a window 119
Summary157

5
Log Files and System Statistics 159
Gathering runtime statistics 159 Configuring the postgresql.conf file 184
Working with PostgreSQL system views 160 Summary191
Creating log files 184 Questions191

6
Optimizing Queries for Good Performance 193
Learning what the optimizer does 193 Understanding execution plans 209
A practical example – how the query Approaching plans systematically 209
optimizer handles a sample query 194 Spotting problems 211
viii Table of Contents

Understanding and fixing joins 217 Handling partitioning strategies 233


Getting joins right 217 Using range partitioning 234
Processing outer joins 219 Utilizing list partitioning 236
Understanding the join_collapse_limit Handling hash partitions 238
variable220
Adjusting parameters for
Enabling and disabling good query performance 239
optimizer settings 221 Speeding up sorting 243
Understanding genetic query optimization 225 Speeding up administrative tasks 246

Partitioning data 226 Making use of parallel queries 247


Creating inherited tables 226 What is PostgreSQL able to do in parallel? 252
Applying table constraints 229 Parallelism in practice 252
Modifying inherited structures 231
Introducing JIT compilation 253
Moving tables in and out of partitioned
Configuring JIT 254
structures232
Running queries 255
Cleaning up data 232
Understanding PostgreSQL 15.x partitioning 233 Summary257

7
Writing Stored Procedures 259
Understanding stored Introducing PL/Perl 292
procedure languages 259 Introducing PL/Python 300
Understanding the fundamentals of stored Improving functions 304
procedures versus functions 261
Reducing the number of function calls 304
The anatomy of a function 261
Using functions for
Exploring various stored
various purposes 307
procedure languages 265
Summary309
Introducing PL/pgSQL 267
Writing stored procedures in PL/pgSQL 290 Questions309

8
Managing PostgreSQL Security 311
Managing network security 311 Managing the pg_hba.conf file 316
Understanding bind addresses Handling instance-level security 321
and connections 312 Defining database-level security 326
Table of Contents ix

Adjusting schema-level permissions 328 Inspecting permissions 340


Working with tables 331 Reassigning objects and dropping
Handling column-level security 332 users344
Configuring default privileges 334 Summary345
Digging into row-level security 335 Questions346

9
Handling Backup and Recovery 347
Performing simple dumps 347 Replaying backups 355
Running pg_dump 348 Handling global data 356
Passing passwords and Summary357
connection information 349
Questions357
Extracting subsets of data 352

Handling various formats 352

10
Making Sense of Backups and Replication 359
Understanding the transaction log 360 Performing failovers and
Looking at the transaction log 360 understanding timelines 383
Understanding checkpoints 361 Managing conflicts 385
Optimizing the transaction log 362 Making replication more reliable 387

Transaction log archiving Upgrading to synchronous


and recovery 363 replication388
Configuring for archiving 364 Adjusting durability 389
Using archiving libraries 365 Making use of replication slots 391
Configuring the pg_hba.conf file 365 Handling physical replication slots 392
Creating base backups 366 Handling logical replication slots 394
Replaying the transaction log 371
Cleaning up the transaction log archive 375 Making use of the CREATE
PUBLICATION and CREATE
Setting up asynchronous replication 376 SUBSCRIPTION commands 397
Performing a basic setup 377 Setting up an HA cluster
Halting and resuming replication 379 using Patroni 400
Checking replication to ensure availability 380
Understand how Patroni operates 400
x Table of Contents

Installing Patroni 401 Summary418


Creating Patroni templates 406 Questions419

11
Deciding on Useful Extensions 421
Understanding how extensions work 421 Encrypting data with pgcrypto 439
Checking for available extensions 423 Prewarming caches with pg_prewarm 439
Inspecting performance with
Making use of contrib modules 426 pg_stat_statements441
Using the adminpack module 426 Inspecting storage with pgstattuple 441
Applying bloom filters 428 Fuzzy searching with pg_trgm 443
Deploying btree_gist and btree_gin 431 Connecting to remote servers
dblink – considering phasing out 432 using postgres_fdw 443
Fetching files with file_fdw 433
Other useful extensions 449
Inspecting storage using pageinspect 435
Investigating caching with pg_buffercache 437 Summary449

12
Troubleshooting PostgreSQL 451
Approaching an unknown database 451 Understanding noteworthy
Inspecting pg_stat_activity 452 error scenarios 462
Querying pg_stat_activity 452 Facing clog corruption 462
Understanding checkpoint messages 463
Checking for slow queries 455 Managing corrupted data pages 464
Inspecting individual queries 456 Careless connection management 465
Digging deeper with perf 457 Fighting table bloat 465
Inspecting the log 458 Summary466
Checking for missing indexes 459 Questions466
Checking for memory and I/O 460
Table of Contents xi

13
Migrating to PostgreSQL 467
Migrating SQL statements Using the OFFSET clause 475
to PostgreSQL 467 Using temporal tables 475
Using LATERAL joins 468 Matching patterns in time series 476
Using grouping sets 468 Moving from Oracle to PostgreSQL 476
Using the WITH clause – common
Using the oracle_fdw extension to move data 476
table expressions 469
Using ora_migrator for fast migration 479
Using the WITH RECURSIVE clause 470
CYBERTEC Migrator – migration for
Using the FILTER clause 471
the “big boys” 480
Using windowing functions 472
Using Ora2Pg to migrate from Oracle 481
Using ordered sets – the WITHIN
Common pitfalls 483
GROUP clause 472
Using the TABLESAMPLE clause 473 Summary485
Using limit/offset 474

Index487

Other Books You May Enjoy 500


Preface
Mastering the art of handling data is an ever more important skill that is important to have. In a digital
world, “data” is more or less the “new oil” – an important asset that drives the world. Every sector of
IT is data-driven. It does not matter whether you are at the forefront of machine learning or whether
you are working on bookkeeping software – at the end of the day, IT is all about data.
PostgreSQL has become a hot technology in the area of open source, and it is an excellent technology
to store and process data in the most efficient way possible. This book will teach you how to use
PostgreSQL in the most professional way and explain how to operate, optimize, and monitor this core
technology, which has become so popular over the years.
By the end of the book, you will be able to use PostgreSQL to its utmost capacity by applying advanced
technology and cutting-edge features.

Who this book is for


This book is ideal for PostgreSQL developers and administrators alike who want to familiarize themselves
with the technology. It will provide you with deep insights and explain advanced technologies such
as clustering, modern analytics, and a lot more.
Prior exposure to PostgreSQL and basic SQL knowledge is required to follow along.

What this book covers


Chapter 1, PostgreSQL 15 Overview, guides you through the most important features that have made
it into the new release of PostgreSQL and explains how those features can be used.
Chapter 2, Understanding Transactions and Locking, explains the fundamental concepts of transactions
and locking. Both topics are key requirements to understand storage management in PostgreSQL.
Chapter 3, Making Use of Indexes, introduces the concept of indexes, which are the key ingredient
when dealing with performance in general. You will learn about simple indexes as well as more
sophisticated concepts.
Chapter 4, Handling Advanced SQL, unleashes the full power of SQL and outlines the most advanced
functionality a query language has to offer. You will learn about windowing functions, ordered sets,
hypothetical aggregates, and a lot more. All those techniques will open a totally new world of functionality.
Chapter 5, Log Files and System Statistics, explains how you can use runtime statistics collected by
PostgreSQL to make operations easier and to debug the database. You will be guided through the
internal information-gathering infrastructure.
xiv Preface

Chapter 6, Optimizing Queries for Good Performance, is all about good query performance and
outlines optimization techniques that are essential to bringing your database up to speed to handle
even bigger workloads.
Chapter 7, Writing Stored Procedures, introduces you to the concept of server-side code such as functions,
stored procedures, and a lot more. You will learn how to write triggers and dive into server-side logic.
Chapter 8, Managing PostgreSQL Security, helps you to make your database more secure, and explains
what can be done to ensure safety and data protection at all levels.
Chapter 9, Handling Backup and Recovery, helps you to make copies of your database to protect yourself
against crashes and database failure.
Chapter 10, Making Sense of Backups and Replication, follows up on backups and recovery and explains
additional techniques, such as streaming replication, clustering, and a lot more. It covers the most
advanced topics.
Chapter 11, Deciding on Useful Extensions, explores extensions and additional useful features that can
be added to PostgreSQL.
Chapter 12, Troubleshooting PostgreSQL, completes the circle of topics and explains what can be done
if things don’t work as expected. You will learn how to find the most common issues and understand
how problems can be fixed.
Chapter 13, Migrating to PostgreSQL, teaches you how to move your databases to PostgreSQL efficiently
and quickly. It covers the most common database systems people will migrate from.

To get the most out of this book


This book has been written for a broad audience. However, some basic knowledge of SQL is necessary to
follow along and make full use of the examples presented. In general, it is also a good idea to familiarize
yourself with basic Unix commands as most of the book has been produced on Linux and macOS.

Software/hardware covered in the book Operating system requirements


Pgadmin4 Windows, macOS, or Linux
PostgreSQL 15
SQL Shell (psql)

Note:
Some parts of chapters i.e., 8, 9, 10, 11,12 and 13 are mostly dedicated to unix / linux and mac
users and rest runs fine on windows.
Preface xv

Download the example code files


You can download the example code files for this book from GitHub at https://github.com/
PacktPublishing/Mastering-PostgreSQL-15-. If there’s an update to the code, it will
be updated in the GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://
github.com/PacktPublishing/. Check them out!

Conventions used
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file
extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “. You
cannot run it inside a SELECT statement. Instead, you have to invoke CALL. The following listing
shows the syntax of the CALL command.”
A block of code is set as follows:

test=# \h CALL
Command:    CALL
Description: invoke a procedure
Syntax:
CALL name ( [ argument ] [, ...] )
URL: https://www.postgresql.org/docs/15/sql-call.html

When we wish to draw your attention to a particular part of a code block, the relevant lines or items
are set in bold:

openssl req -x509 -in server.req -text


  -key server.key -out server.crt

Any command-line input or output is written as follows:

# - Connection Settings –
# listen_addresses = 'localhost'
# what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
xvi Preface

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance,
words in menus or dialog boxes appear in bold. Here is an example: “Select System info from the
Administration panel.”

Tips or important notes


Appear like this.

Get in touch
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at customercare@
packtpub.com and mention the book title in the subject of your message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen.
If you have found a mistake in this book, we would be grateful if you would report this to us. Please
visit www.packtpub.com/support/errata and fill in the form.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would
be grateful if you would provide us with the location address or website name. Please contact us at
[email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you
are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts


Once you’ve read Mastering PostgreSQL 15, we’d love to hear your thoughts! Please click here to go
straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering
excellent quality content.
Preface xvii

Download a free PDF copy of this book


Thanks for purchasing this book!
Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?
Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.
Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical
books directly into your application.
The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content
in your inbox daily
Follow these simple steps to get the benefits:

1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781803248349

2. Submit your proof of purchase


3. That’s it! We’ll send your free PDF and other benefits to your email directly
1
PostgreSQL 15 Overview
A full year has passed and the PostgreSQL community has released version 15 of the database, which
includes various powerful new features that will benefit a large user base. The PostgreSQL project
has also come a long way and improvements are being added constantly at a rapid pace that make
the database more useful, more efficient, and more widely accepted. The times when PostgreSQL was
some unknown obscure thing are long gone. PostgreSQL has reached the data center and has been
widely adopted in many large companies as well as by governments around the world.
In this chapter, you will learn about new features that made it into PostgreSQL 15. Those features add
additional capabilities, more performance, as well as security and enhanced usability.
The following topics are covered in this chapter:

• DBA-related features
• Developer-related features
• Performance-related features
• Additional replication features

Of course, there is always more stuff. However, let us focus on the most important changes affecting
most users.

Making use of DBA-related features


In PostgreSQL 15, a couple of developer-related features were added. Some features were also finally
deprecated and have been removed from the server. In this section, we will go through the most
important major changes.

Removing support for old pg_dump


One of the first things that is worth noting is that support for really old databases has been removed
from pg_dump. PostgreSQL databases that are older than PostgreSQL 9.2 are not supported anymore.
2 PostgreSQL 15 Overview

Considering that PostgreSQL 9.2.0 was released to the PostgreSQL community FTP server on September
10, 2012, most people should have gotten rid of their PostgreSQL 9.1 (and older) systems by now.
If you have not been able to upgrade since then, we highly recommend doing that. It is still possible
to upgrade from such an old version to PostgreSQL 15. However, you will need an intermediate step
and to use pg_dump twice.

Deprecating Python 2
PostgreSQL allows developers to write stored procedures in various languages. This includes Python
but is not limited to it. The trouble is that Python 2.x has been deprecated for a long time already.
Starting with version 15, the PostgreSQL community has also dropped support for PL/Python2U and
only supports version 3 from now on.
This means that all code that is still in Python 2 should be moved to Python 3 in order to function properly.

Fixing the public schema


Up to PostgreSQL 14, the public schema that exists in every database has been available to every
user. This has caused various security concerns among the user base. Basically it is easy to just use
the following:

REVOKE ALL ON SCHEMA public FROM public;

This was rarely done but caused security leaks people were generally not aware of. With the introduction
of PostgreSQL, the situation has changed. The public schema is, from now on, not available to the
general public and you have to be granted permission to use it like before. The new behavior will make
applications a lot safer and ensure that permissions are not there accidentally.

Adding pre-defined roles


In recent versions of PostgreSQL, more and more pre-defined users have been added. The core idea
is to ensure that people do not have to use their superuser accounts so often. For security reasons, it
is not recommended to use superusers unless explicitly needed. However, with the introduction of
pre-defined roles, it is a lot easier to run things without superusers:

test=# SELECT rolname


FROM pg_authid
WHERE oid < 16384
AND rolname <> CURRENT_USER;
          rolname
Making use of DBA-related features 3

---------------------------
pg_database_owner
pg_read_all_data
pg_write_all_data
pg_monitor
pg_read_all_settings
pg_read_all_stats
pg_stat_scan_tables
pg_read_server_files
pg_write_server_files
pg_execute_server_program
pg_signal_backend
pg_checkpointer
(12 rows)

With the introduction of PostgreSQL, a new role has been added, pg_checkpointer, which allows
users to manually run checkpoints if needed.

Adding permissions to variables


However, there is more. It is now possible to define permissions on variables. This was not possible
before version 15. Here is an example:

GRANT SET ON PARAMETER track_functions TO hans;

This new feature allows administrators to disable bad behavior and prohibit bad parameter settings
that can compromise the availability of the entire server.

Improving pg_stat_statements
Every version will also provide us with some improvements related to pg_stat_statements,
which in my judgment is the key to good performance. Consider the following code snippet:

test=# \d pg_stat_statements
                      View "public.pg_stat_statements"
         Column         |       Type       | ...
------------------------+------------------+ ...
userid                 | oid              | ...
...
jit_functions          | bigint           | ...
4 PostgreSQL 15 Overview

jit_generation_time    | double precision | ...


jit_inlining_count     | bigint           | ...
jit_inlining_time      | double precision | ...
jit_optimization_count | bigint           | ...
jit_optimization_time  | double precision | ...
jit_emission_count     | bigint           | ...
jit_emission_time      | double precision | ...

The module is now able to display information about the JIT compilation process and helps to detect
JIT-related performance problems. Those problems are not too frequent – however, it can happen that
once in a while, a JIT compilation process takes too long. This is especially true if you are running a
query containing hundreds of columns.

New wait events


What is also new in PostgreSQL is a couple of wait events that give you some insights into where time
is the list. The following events have been added to the system:

• ArchiveCommand
• ArchiveCleanupCommand
• RestoreCommand
• RecoveryEndCommand

Those events complement the existing wait event infrastructure and give some insights into
replication-related issues.

Adding logging functionality


PostgreSQL 15 comes with a spectacular new feature: JSON logging. While JSON is comparatively large
compared to the standard log format, it still comes with a couple of advantages, such as easy parsing.
Let us configure JSON logging in postgresql.conf:

log_destination = 'jsonlog'     # Valid values are combinations


of
                                # stderr, csvlog, jsonlog,
syslog, and
                                # eventlog, depending on
platform.
                                # csvlog and jsonlog require
                                # logging_collector to be on.
Making use of DBA-related features 5

# This is used when logging to stderr:


logging_collector = on
                                # Enable capturing of stderr,
jsonlog,
                                # and csvlog into log files.
Required
                                # to be on for csvlogs and
jsonlogs.
                                # (change requires restart)

The output might look as follows:

[hs@hansmacbook log]$ head postgresql-Fri.json


{"timestamp":"2022-11-04 08:50:59.000
CET","pid":32183,"session_id":"6364c462.7db7","line_
num":1,"session_start":"2022-11-04 08:50:58
CET","txid":0,"error_severity":"LOG","message":"ending log
output to stderr","hint":"Future log
output will go to log destination \"jsonlog\".","backend_
type":"postmaster","query_id":0}
{"timestamp":"2022-11-04 08:50:59.000
CET","pid":32183,"session_id":"6364c462.7db7","line_
num":2,"session_start":"2022-11-04 08:50:58
CET","txid":0,"error_severity":"LOG","message":"starting
PostgreSQL 15.0 on x86_64-apple-
darwin21.6.0, compiled by Apple clang version 13.1.6
(clang-1316.0.21.2.5), 64-
bit","backend_type":"postmaster","query_id":0}

Reading a tightly packed file containing millions of JSON documents is not really user-friendly, so I
recommend using a tool such as jq to make this stream more readable and user-friendly to process:

[hs@hansmacbook log]$ tail -f postgresql-Fri.json | jq


{
  "timestamp": "2022-11-04 08:50:59.000 CET",
  "pid": 32183,
  "session_id": "6364c462.7db7",
  "line_num": 1,
  "session_start": "2022-11-04 08:50:58 CET",
6 PostgreSQL 15 Overview

  "txid": 0,
  "error_severity": "LOG",
  "message": "ending log output to stderr",
  "hint": "Future log output will go to log destination
\"jsonlog\".",
  "backend_type": "postmaster",
  "query_id": 0
}
{
  "timestamp": "2022-11-04 08:50:59.000 CET",
  "pid": 32183,
  "session_id": "6364c462.7db7",
  "line_num": 2,
  "session_start": "2022-11-04 08:50:58 CET",
  "txid": 0,
  "error_severity": "LOG",
  "message": "starting PostgreSQL 15.0 on x86_64-apple-
darwin21.6.0, compiled by Apple clang version
13.1.6 (clang-1316.0.21.2.5), 64-bit",
  "backend_type": "postmaster",
  "query_id": 0
}
{
  "timestamp": "2022-11-04 08:50:59.006 CET",
  "pid": 32183,
  "session_id": "6364c462.7db7",
  "line_num": 3,
  "session_start": "2022-11-04 08:50:58 CET",
  "txid": 0,
  "error_severity": "LOG",
  "message": "listening on IPv6 address \"::1\", port 5432",
  "backend_type": "postmaster",
  "query_id": 0
}
...

In general, it is recommended to not use JSON logs excessively as they occupy a fair amount of space.
Understanding developer-related features 7

Understanding developer-related features


Administration-related features are not everything. PostgreSQL 15 also provides some developer-
related features that are useful to build even more powerful applications. In this section, you will
learn which ones are available.

Security invoker views


In PostgreSQL, a view is a separate security context. It might happen that somebody is allowed to
access a view but not the underlying table. Why does this matter? Consider the following scenario:

• Joe is allowed to see all sales


• Jane is only allowed to see total turnover by country

Jane will be granted rights on a view that sums up the data. She will be able to read that view without
having the right to read the sales table directly.
However, in PostgreSQL, it is now possible to make PostgreSQL treat the view more like a preprocessor
directive. By setting security_invoker, it will also check the underlying tables and not treat the
view as a separate security context anymore:

CREATE VIEW sample_view WITH (security_invoker=true)


AS SELECT * FROM some_table WHERE id < 100;

This feature is a classic example of open source sponsoring. It has been paid for by donations to a
private company.

ICU locales
ICU locales are a truly important feature of PostgreSQL. Why is this relevant? The locale determines
the sort order of characters. We all take our own sort order for granted (a, b, c, … ). However, not all
languages sort equally. In some languages, some characters simply show up in different sequences.
For the better part of the last 35 years, the sort order used by PostgreSQL has been provided by the
underlying C library (the standard OS library). The problem is that the sort order of characters can
change over time. Why does this matter? Because it breaks indexing.

Remember
Indexes are basically sorted lists. The trouble is when the sort order changes, your sorted list
will be wrong, which of course matters if we are talking about tables in the TB range. This is a
real issue as a changing locale can result in silently corrupted indexes.
8 PostgreSQL 15 Overview

The ICU library has been designed to fix those issues and provide a stable platform for such locale-
related issues. Since PostgreSQL, it is now possible to use ICU locales on the instance as well as on
the database library. The following code snippet shows an example:

initdb --locale-provider=icu --icu-locale=en_US


CREATE DATABASE foo TEMPLATE template0
LOCALE_PROVIDER 'icu'
ICU_LOCALE 'fi'

It is highly recommended to make use of the ICU library to handle locales in general. It makes long-
term deployments more future-proof.

Better numeric
Locales are not the only thing that has been improved. The numeric data type has also gotten a boost
and some new features have been added. Consider the following code snippet:

test=# SELECT 1234::numeric(5,1),


        1234::numeric(5,0),
        1234::numeric(5,-1);
numeric | numeric | numeric
---------+---------+---------
  1234.0 |    1234 |    1230
(1 row)

It is now possible to define numeric types carrying a negative scale.


In addition to that, PostgreSQL is not able to have a scale greater than the precision of the field:

test=# SELECT 0.01::numeric(2,3);


numeric
---------
   0.010
(1 row)

All those features come in handy and make the data type more useful in general.
Understanding developer-related features 9

Handling ON DELETE
The ON DELETE SET NULL mechanism has been around for many decades. However, from version
15 onward, it is now possible to set only some of the NULL columns:

CREATE TABLE n_side_of_the_model (


...
FOREIGN KEY (col1, col2, col3)
REFERENCES one_side_of_the_er_model
ON DELETE SET NULL (col2, col3)
);

This feature will greatly improve the functionality of foreign keys and make them even more useful.

Working around NULL and UNIQUE


There is also news around NULL handling. Normally, a UNIQUE constraint handles NULL values as
different values. Remember: NULL means undefined and therefore we don’t know whether undefined
1 is the same as undefined 2. This constraint is not violated. Here is an example:

test=# CREATE TABLE t_null (id int UNIQUE);


CREATE TABLE
test=# INSERT INTO t_null VALUES (1);
INSERT 0 1
test=# INSERT INTO t_null VALUES (NULL);
INSERT 0 1
test=# INSERT INTO t_null VALUES (NULL);
INSERT 0 1

As you can see, two NULL values are perfectly fine. However, this might not be desirable. Let us drop
the table and start all over:

test=# DROP TABLE t_null;


DROP TABLE

New syntax has been added to handle the NULL-related behavior:

test=# CREATE TABLE t_null (id int UNIQUE NULLS NOT DISTINCT);
CREATE TABLE
test=# INSERT INTO t_null VALUES (1);
INSERT 0 1
10 PostgreSQL 15 Overview

test=# INSERT INTO t_null VALUES (NULL);


INSERT 0 1
test=# INSERT INTO t_null VALUES (NULL);
ERROR:  duplicate key value violates unique constraint "t_null_
id_key"
DETAIL:  Key (id)=(null) already exists.

As we can see, the third INSERT will error out and throw a message.

Adding the MERGE command to PostgreSQL


The MERGE command is surely one of the most important new features provided by PostgreSQL 15.
It has been in the making for many years and has finally been committed to the PostgreSQL core as
part of the new release.
What is the idea of MERGE? Well, INSERT … ON CONFLICT is basically “upsert” while MERGE
solves a totally different problem.
How does MERGE work? Let us take a look at the syntax first:

test=# \h MERGE
Command:     MERGE
Description: conditionally insert, update, or delete rows of a
table
Syntax:
[ WITH with_query [, ...] ]
MERGE INTO target_table_name [ [ AS ] target_alias ]
USING data_source ON join_condition
when_clause [...]
where data_source is:
{ source_table_name | ( source_query ) } [ [ AS ] source_alias
]
and when_clause is:
{ WHEN MATCHED [ AND condition ] THEN { merge_update |
merge_delete | DO NOTHING } |
  WHEN NOT MATCHED [ AND condition ] THEN { merge_insert | DO
NOTHING } }
and merge_insert is:
INSERT [( column_name [, ...] )]
[ OVERRIDING { SYSTEM | USER } VALUE ]
Random documents with unrelated
content Scribd suggests to you:
he had been well compensated for his compulsory retirement from
active life and expected to invest his capital in some small business,
to which affluent position, under ordinary conditions, he never could
have aspired with any degree of confidence. Wilson’s disposition was
to go back to the sea with me, so I bought the “Nettie H,” a handy
little steamer, and put her into the Chinese smuggling trade. I took
command of the steamer, with Leigh as sailing master, and put
Wilson in charge of the schooner, as I could trust him with the least
anxiety. He had none of Leigh’s love for liquor and the result of his
carelessness with the “Ferret” had made him as careful as a Scot.
While the “Nettie H” was being fitted out, the authorities warned me
that they knew what I was up to and it would go hard with me if
they secured proof of their suspicions, but, knowing they were only
shooting in the air, I laughed at them.
If this business of carrying Chinese under cover had been as
productive of adventure as it was of profits, I would have stuck to it
indefinitely, but it was so absolutely devoid of excitement that it
palled on me. After we had made eight or nine trips, which more
than repaid my financial losses ashore, I withdrew from the trade,
with the idea of returning to the seductive West Indies, where I
imagined there were higher-class operations to be conducted, and
more thrilling times to be found. While I was disposing of my ships
and finally closing up my Australian affairs, I was in Sydney for
several weeks and stopped at the Imperial Hotel, where I met and
became well acquainted with Guy Boothby, the English novelist.
Though he dreamed away his inborn love of adventure, while I
industriously practised mine and made it my life, he was a good deal
of a kindred spirit, and in the course of our numerous long talks I
told him enough about my experience with the Beautiful White Devil,
without going into any of the detailed and intimate facts which have
been told in these confessions, so that he subsequently wove a
romance about her, using her sobriquet as a title for the story.
Accompanied by Leigh and Wilson, who were going only as far as
England, I boarded a steamship for London, on my way back to New
York. It would have been easier and quicker for me to have returned
by way of San Francisco, but I involuntarily selected the roundabout
way, to soon find that it led me into a unique and altogether
unexpected experience.
CHAPTER XIII
ADVENTURES ON THE NILE

WHEN I finally forsook Australia, near the close of 1889,


accompanied by Leigh and Wilson, who had paid a penitentiary
penalty for my revengeful ambition and their own carelessness, I
was in no particular hurry to get anywhere, but had no thought of
stopping off at any point short of London until we reached
Alexandria. Immediately on our arrival there I was suddenly seized
with a freak of fancy, as we nonchalantly speak of the immutable
decrees of Fate when we wish to show an independence of action
we do not feel, to visit Cairo, and without waste of time and energy
in mental argument I sent my dunnage ashore by one of the
thousand or more small boats which viciously assaulted the ship
from all sides. My two companions, after their trying times in
Melbourne, were anxious to get back among their own people, so
they went on to London, which decision was reached without the
slightest effort to conceal their comments on my erratic disposition,
while I proceeded to the ancient capital of the Kings of Egypt—those
glorious old marauding monarchs who made despotism a fine art
and graft a religion. There I was projected into a most alluringly
adventurous undertaking. Though failing utterly of its high purpose,
it was by no means devoid of compensations, for it initiated me far
enough into the mysteries of departed days so that I considered
myself at least an entered apprentice, and, furthermore, it carried
me into close relationship with an exquisitely beautiful woman,
which, next to plotting against peace and fighting out the plan, is
always the thing most to be desired. As a matter of fact it is the rule
in the Orient, where man is less virile and more devious and discreet
than in the newer world, that a handsome woman is a part of every
properly promoted plot, and this one was no exception.
Under my British name of George MacFarlane I stopped at
Shepheard’s Hotel, then the home of all pilgrims, and gave myself up
to the enjoyment of new scenes while I waited, in no sense
impatiently, for the development of the situation through whose
coming I had been summoned. It was at the height of the tourist
season, following the Christmas holidays, and there was an
abundance of company, made up of cultured Europeans and a few
Americans of gentle birth, for that was before Cairo was over-run
with the over-rich. The time was delightfully whiled away for a
month before anything happened to indicate the reason for my
being there, but within less than half of that time I had renewed
acquaintance with the man who was really the key to the situation,
though I did not suspect it at the time. He and I had been strangely
thrown together some years before, under conditions which
provoked rather an intimate knowledge of each other, and when we
met on the street one day the recognition was instant and mutual.
He did not inquire into my business but simply asked what name I
was travelling under, in order that he might not embarrass me. He
stood in close and confidential relation to Tewfik Pasha, the Khedive,
and on that account it is best that there should be no hint, even
now, as to his name or nationality.
I wished to see the titular ruler of Egypt at close range, and through
my old companion-in-arms I secured an invitation to the Khedive’s
annual ball at the Abdin Palace. This function, which naturally was
the event of the year, was rendered impressive by all the artistry of
the East, and it was a most brilliant spectacle. At the ends of every
step in the long stairway leading up to the palace stood immobile
footmen, who suggested past glories despite their costume, which
was decidedly English, save for the ever-present fez. Inside, there
was an endless succession of long mirrors set in the walls, which
multiplied the jewels of the women and the gay uniforms of the
officers and diplomats into a flashing mass of colors; countless
palms scattered profusely through the large rooms, and gorgeous
chandeliers illuminated with candles, but there was not so much as a
hint of furniture. Had there been any place where the guests could
lounge or sit, beyond the floor, the chances are that some of them
would have stayed there until the next day, at least, in the absence
of physical violence as an aid to their departure. The only ladies
present were Europeans and some few favored Americans, but from
wide corridors behind the musharabiyeh, or fretwork around the
frieze of the walls, the Khedivah and her women attendants had a
good view of the proceedings without danger of being seen. They
were equally secure from any possibility of intrusion, for every
avenue that led in their direction was guarded by offensively
haughty eunuchs.
I was purposely close to the end of the long line of people who were
presented to the Khedive, for I wanted to study him. He was about
five and a half feet tall, with straight black hair, black moustache, an
olive complexion, brown eyes that were more than alert, and a
rather Roman nose, giving a Jewish cast to his face, which always
wore a very bored expression except when he was interested. His
hand was small but firm—such a hand as would commit murder if
the owner were sure it would not be found out. There was nothing
of the brave man in his looks or actions. Polite and insinuating by
nature, he was never born to lead. Rather, he suggested the favorite
and tool of the Sultan, who would take some small chance of losing
his head with a sufficiently large reward in the other side of the
scale. He wore that night, and always, a single-breasted frock coat,
like that of an Episcopal clergyman. He spoke English correctly but
with an accent, and aversion as well; French he loved and spoke like
a Parisian. I had been given advance information on this point, so
when I was introduced, following a string of Englishmen and
Americans, I addressed him in French. Instantly the weary look
vanished and his face lighted up until he became almost handsome.
“Ah,” he exclaimed, as he gripped my hand with more force than I
had previously seen him display, “you are a Frenchman. I am
delighted.”
I made some polite reply and he went on, almost excitedly, “I love
the French language, but I do not like the English. I speak it only
because I have to. The Khedivah is more fortunate. She does not
speak it at all, and she never will learn it.”
We exchanged commonplaces for a moment and I passed on,
wondering to what extent England could trust this man, who hated
her tongue and made no secret of it.
Cairo has been described so often and in so many ways by people
who had nothing better to write about that I have no wish to add to
the literature on that subject, but I cannot refrain from speaking, in
passing, of one unusual scene which, so far as I have read, has for
all of these years escaped the attention of literary loiterers. With my
mind far back in centuries that are forgotten, in lands devoid of
imperishable monuments like those around me, I had stayed on the
summit of Cheops so long, one afternoon, that my dragoman
declared I would have trouble in reaching the bottom before dark.
Half-way down I paused for a glimpse at Cairo, with every minaret
standing out boldly in the strong light. Then, suddenly, almost at my
feet, the sinking sun created the shadow of the Great Pyramid, and
it began to move. It advanced almost imperceptibly, at first, but
gathered headway quickly and in a moment it was rushing across
the twelve-mile plain toward the city with the speed of an express
train, as it seemed to me; I am sure no race horse could have kept
pace with it. When the shadow reached the Mokattam Hills it paused
for an instant and then began, slowly and more slowly and with
apparent difficulty, to climb the high side of the Citadel Mosque.
When it was half-way up the wall the sun dropped out of sight like a
shot and we were buried in Egyptian darkness, which, be it said, is
no simple figure of speech. In a few minutes, however, we were able
to complete our descent of the gigantic steps by the light of the
brilliant afterglow, which spread its soft radiance over the land.
As I was enjoying my after-dinner cigar one evening in a quiet
corner of the garden in front of the hotel, I was approached by three
women pedlers, apparently of the fellah class. They wore the
common blue kimono-like garment, held together seemingly by luck,
and their small black veils were thrown over their heads, leaving
their faces bare and thus placing them outside the pale of Egyptian
respectability. I was about to walk away to avoid their pestering,
when my eyes met those of the one who was in the lead, and
instantly I was attracted in place of being repelled. Great, brilliant
eyes they were; not fickle and flirtatious, like those of the thinly
veiled beauties of the harem who were seen in their coupes on the
Shoobra Road every afternoon, nor sullen or sensuous, like those of
the class to which her garb gave her claim; but steady and sincere,
wide-open and frank, and in them shone a light that converted into
specks the lanterns with which the grounds were illuminated. Such
eyes do not come in one generation, not even by chance, nor are
they born of the soil. Her face was of the pure Egyptian type, gentle
in its contour and refined in every line, with perfectly arched
eyebrows and a mass of hair as black as her eyes, and her easy
carriage emphasized the grace of her tall, lithe figure, the curves of
which not even her coarse robe could entirely conceal.
Her sparkling eyes, turned full on me and ignoring all else, told me
as plainly as words could have done that she had some message for
me, and, suspecting that the moment for which I had been waiting
for weeks had arrived, I walked slowly toward her, as though in a
mood to barter. As we met, seemingly somewhat disconcerted by my
steady gaze of profound and unconcealed admiration, she drew her
uncouth veil across her face and held out her hands, like one trained
to tourist trade, that I might examine her wonderful rings. Those
hands could never have known work, they were so soft and small,
and arms more perfectly rounded were never modelled in marble by
a master. Plainly this woman was not of the servant class, to which
her companions as clearly belonged. One of her hands was half-
closed and as she laid it in mine it opened and a small piece of
folded paper fell into my palm. Long accustomed to ways out of the
ordinary, I gave no sign, beyond an involuntary start which she felt
but no one else noticed, and proceeded with outward calmness, and
assuredly with much deliberation, to select a ring, which I purchased
as a souvenir of our first meeting. It was set with an uncut ruby in a
band of gold so fine that it was removed from her tiny finger, which
it encircled nearly twice, simply by pressing the ends outward. Not a
word passed between us except as to the price of the ring, over
which there was no haggling. The women who were with her made
a pretence of showing me their wares, but it was only a show for the
benefit of any inquisitive persons who might be watching, and
without urging me to buy they passed on. I strolled after them and
was interested in observing that as they approached other guests
the woman who had slipped me the note remained in the
background, with her face veiled, leaving commerce to her
companions. They attempted to make only a few sales and then
disappeared.
Curious to a degree that surprised me, as to the contents of the
communication which had come to me so strangely, but fearful of
being watched, by I knew not whom, it was some time before I
went to my room to read the note by the light of a tallow candle.
The mysterious missive read: “You are Captain Boynton. Are you
willing to undertake a difficult and perhaps dangerous mission?
Answer to-morrow night through the channel by which you receive
this.”
Here was a romantic promise of something new and real in the way
of excitement, for I could imagine nothing stereotyped growing out
of such an unusual beginning, and I rejoiced. The answer to the
inspiring invitation, which I promptly burned from discretion while
sentiment told me to keep it, required no thought, and as I am not
much given to the exertion of energy in seeking solutions for difficult
problems that will soon supply their own answers, I did not greatly
concern myself as to the purpose of the plot in which I was sought
as a partner. Inasmuch as the only man in Cairo who knew me as
Captain Boynton, and who was acquainted with my favorite
occupation, was a confidant of the Khedive, it naturally occurred to
me that the oily Tewfik Pasha was mixed up in it in some way, and I
suspected that it involved another secret movement against British
rule in Egypt. The latter suspicion was soon verified and there never
has been any doubt in my own mind that I was equally correct in the
conjecture as to the participation, or at least the silent approval, of
Tewfik, but this could not be proved.
Knowing the mystery-loving nature of the Egyptians and feeling sure
that if left wholly to their own ways they would entertain themselves
with a long correspondence which could do no good and might
arouse suspicion, I determined to bring matters to a head as quickly
as possible. It was evident that those who sought my services knew
much about me and it was quite as important to me that I should
know them. The next evening, before going down to dinner, I wrote
my answer. “Yes,” I replied to the encouraging query, “provided it is
something a gentleman can do, and I am well paid for it. But I will
conduct no negotiations in this way. I must see the people I am
doing business with.”
After dinner I retired to the same out-of-the-way corner of the
garden in which I had been found the night before, on the side
farthest away from the hotel and the music, to await developments.
It probably was not long, but it seemed hours, before the same
three women came up the short flight of steps running down to the
street. The one who was doing duty as a letter carrier, and who bore
the imaginative name of Ialla, was the last to appear. On reaching
the level of the garden her eyes roamed quickly around until they
turned toward where I was sitting. Seeing me, she drew her veil
across her face, as though she resented being classed with the
unregenerate fellahin, and wished to show more discrimination in
her love affairs than they could boast, and accompanied her
companions in their ostensible bargaining tour among the guests. To
one who paid them even casual attention they must have appeared
as timid traders, so lacking were they in the customary insistence,
and it was with small profits and no great loss of time that they
found their way around to me. As on the night before, it was left to
Ialla to barter with me. I again took both of her hands in mine, to
examine her jewelry, of which she wore a wealth that, like her looks,
belied her dress, and as I did so I slipped into one of them the
tightly folded note which I had been gripping for an hour or more.
Her jewels were much richer than those she had worn the previous
evening and as I studied their barbaric beauty I softly pressed her
childish hands, as the only means of conveying something of the
impression she had made on me, for I did not know the extent to
which the other women were in our secret or could be trusted. Her
only response was one quick glance, which I interpreted as a
mixture of pleasure, surprise, and interrogation; the one distinctly
pleasant thing about it was that it contained nothing of indignation
or hostility. Save for that electric flash her wonderful eyes looked
modestly downward and her whole attitude was one of perfect
propriety, which more than ever convinced me that she was not
what she pretended to be. Finally she drew her hands away,
hurriedly but gently, and with an impatient gesture, as though she
had made up her mind that I had no idea of making a purchase, led
her companions out of the garden.
There was no sign of either Ialla or her two friends the next evening,
though I watched for them closely. On the second afternoon I
received a call from my old friend, who undoubtedly had
recommended me and vouched for me to the people who had
opened up the exceedingly interesting correspondence. It was
apparently a casual visit but its purpose was revealed when, in the
course of a general conversation regarding the country and its ways,
along which he had cleverly piloted me, he said: “These Egyptians
are a remarkable people. I have lived among them long enough to
know them and to admire, particularly, their sublime religious faith
and their exalted sense of honor. With their enemies, and with the
travellers on whom they prey, they are tricky and evasive to the last
degree, but in their dealings with people whom they know and trust
they are the most honorable men in the world. I don’t know whether
you expect to have any dealings with them, but if you do, you can
trust them absolutely.”
With that opening I was on the point of speaking to him about the
note I had received and answered, but before I could say a word he
had started off on another subject, leaving me to understand that he
knew all about the matter but did not wish to talk of it, and that he
had taken that method, learned from the diplomats, of endorsing the
people with whom he had put me in communication. We gossiped
on for some time, but though each knew what was uppermost in the
other’s mind neither of us spoke of it, nor was the subject even
indirectly referred to again.
This conversation indicated that the veiled proceedings were nearing
the point of a personal interview with some one who knew
something about the scheme, and when I took my seat in the
garden that evening I was impatient for further unfoldings. Not
knowing what might happen, and despite the afternoon’s guarantee
of good faith from a man I had every reason to trust, I took the
precaution to arm myself with two Tranter revolvers. I had not been
waiting long when Ialla and her two companions appeared and came
straight toward me, but without any sign of recognition. As she
passed close beside me, walking slowly, Ialla whispered, almost in
my ear: “Follow me at ten o’clock.”
It was then about nine-thirty. The inharmonious trio moved on into
the throng of guests and, as the time passed, gradually worked their
way around toward the stairway leading down to the street. A few
minutes before ten I descended into the street to wait for them, so it
could not be seen from the hotel that I was following them.
Promptly on the hour Ialla and her attendants came down the steps
and set off toward Old Cairo, which, however much it may have
been spoiled since, was then just the same as when Haroun-al-
Raschid used to take his midnight rambles. At the corner of the hotel
two men dressed as servants stepped out of a shadow and fell in
close behind them, apparently to prevent me from engaging them in
conversation, which, but for this barrier, I assuredly would have
done. With all amorous advances thus discouraged I remained far
enough behind so that it would not appear that I was one of the
party. They led me almost the full length of the Mooshka, the main
street of the old town and the only one wide enough to permit the
passing of two carriages; turned into one of the narrow side streets,
then into another and another until they stopped at last in front of a
door at the side of one of the little shops. When I was within
perhaps fifty feet of them Ialla entered the door, after looking back
at me, while her four companions walked rapidly on down the street.
I pushed open the door, which was immediately closed by a servant
who dropped a bar across it, and found Ialla waiting for me in a
dimly lighted hallway. She led me nearly to the end of the long hall,
opened a door and motioned to me to enter and closed the door
from the outside. I found myself in a large room, which, after my
eyes had become accustomed to the half light, I saw was
magnificently furnished. A fine-looking old Arab, with gray hair and
beard, was seated on an ottoman, smoking a bubble pipe. His
bearing was majestic and for the purpose of easy identification he
will be known here as Regal, though that was not his name.
“I am glad to see you, Pasha Boynton,” was his greeting, in a deep,
strong voice. He proved himself a man of action, and advanced
himself greatly in my esteem by giving no time to idle chatter. “We
know you well,” he said, “through trustworthy information, as a
soldier and a sailor, and we believe you are peculiarly well equipped
for the work we wish you to undertake. It is a sea-going expedition,
involving danger of disaster on one hand and the cause of liberty
and a substantial reward on the other. Are you willing to attempt it?”
“If you are open to reasonable terms and I am given full command
of the expedition, I will gladly undertake it,” I replied. “If it furnishes
real adventure I will be quite willing to accept that in part payment
for my services.”
“Then we should be able to agree without difficulty,” he answered
with a grim smile. “But,” he added, as his keen face took on a stern
expression and his eyes looked through mine into my brain,
“whether or not we do reach an agreement, we can rely on you to
keep our secret and to drop no hint or word through which it might
be revealed?”
“Absolutely,” I replied, and my gaze was as steady as his. He studied
me intently for a full minute and then said decisively, in the Arabic
fashion: “It is good.”
Without further ceremony he let me into the whole plot. At the
bottom of it was the old cry of “Egypt for the Egyptians,” which is
not yet dead and probably will not die for centuries, if ever. It was
Arabi Pasha who made the last desperate fight under this slogan and
it was his release from exile that was sought by the plotters, in order
that he might renew the war for native liberty. As a military genius
Arabi ranked almost with the great Ibrahim Pasha, who died a few
years after Arabi was born, and he was fanatical in his love of
country. From a Colonel in the army he became Under Secretary of
War and then Minister of War, in which position he was practically
the Dictator of Egypt. With the aid of a secret society which he
organized among the native officers of the army, and the carefully
concealed support of the Sultan, who had protested vainly against
the assumption of authority by the British and French over this part
of Turkish territory, he planned and executed a revolt through which
it was hoped to restore native control of Egypt. The French, more
sentimental than selfish, and reluctant to take extreme measures,
withdrew at the last moment, leaving it to the British to prosecute
the war, which they did with characteristic vigor. The bombardment
of Alexandria, on July 11 and 12, 1882, and the rout of his army at
Tel-el-Kebir two months later, dissipated Arabi’s dream and, so far as
surface indications were concerned, established British rule in Egypt,
exclusively and permanently. The movement which Arabi had
fostered apparently collapsed with that battle, and he was exiled to
Ceylon for life.
Briefly and bitterly this bit of history was reviewed by the old Arab.
Then he became more animated. He said the loyal Egyptians had
been planning a new movement against the British, with great
secrecy, for a long time, and that the natives and a large part of the
army were ready to rise in revolt whenever the signal was given.
The butchery of the gallant “Chinese” Gordon at Khartoum—a stain
on England’s fame which never can be blotted out—had checked the
British advance in the Soudan and to some extent paralyzed the
officials who, from the safe haven of the War Office in London, were
drawing up plans of conquest, and the conspirators believed the
time had come for what they were confident would prove a
successful and final blow for freedom. But, to make this ardently
desired result more certain, they needed the inspiring leadership of
Arabi Pasha, in whose talent for conflict they still had great faith,
which doubtless was intensified by his enforced absence.
Furthermore, Regal explained, the superstitious natives would hail
his unexpected return from exile as a sign that they could not be
defeated and would fight more desperately and determinedly than
before. Through spies it had been learned that Arabi was confined at
a point near the coast, only a short distance from Colombo, the
capital of Ceylon. He was allowed considerable freedom, within
certain prescribed limits, and was in the custody of only a small
guard. His escape was regarded as impossible and the idea that an
attempt might be made to rescue him seemingly had not entered
the minds of those responsible for his safe-keeping.
Yet that was precisely what I was asked to accomplish. After Regal
had stated the conditions of Arabi’s captivity he dramatically
declared, with flashing eyes: “The fires which the British foolishly
thought they had stamped out, were not, and could never be,
extinguished. They have been smouldering ever since and are now
ready to burst into a flame that will consume everything before it.
We need only the presence of the great Arabi. You can bring him to
us. With a ship, whose true mission is concealed by methods of
which we know you to be a master, you can sail to a point close to
his place of confinement. As soon as it is dark and quiet forty or fifty
of our brave men, who will accompany you, will be landed. They will
steal upon his guards and silence them and return with the General
to your ship. There will be none left to give the alarm and by the
time it is discovered that he has been snatched away from their
cursed hands you will be far out of sight, and with your knowledge
of the ways of those who sail the sea it should not be difficult for
you to avoid capture. You will land Arabi at some point to be decided
on, from which he can make his way to Cairo. With his coming our
banners will be unfurled and Egypt will be restored to the Egyptians.
It is a mission in the cause of freedom and humanity. Are you willing
to undertake it?”
Long before he reached it, I saw his objective point, and ran the
whole scheme over in my mind while he was laying down its
principles. It did not strike me as being at all foolhardy. As I have
said before, it is the so-called impossibilities which, when they are
not really impossible, as few of them are, can be most easily
accomplished, for the reason that they are not guarded against.
Under the conditions described, the rescue of Arabi would be
comparatively a simple matter. The chief danger would come from
the British warships which would swarm the seas as soon as his
disappearance was discovered, for it would be a natural conclusion
that he was on some vessel on his way back to Egypt. This danger
appealed to me, for it augured well for adventure. It would be a
game of hide-and-seek, such as I intensely enjoyed, with my wits
pitted against those of the British Navy, and with my varied
experiences in deep-sea deception, I did not consider that the odds
against me would be overwhelming. Therefore I promptly assured
the old patriot, whose anxiety and excitement were shown in his
blazing eyes, that I would cheerfully assume responsibility for Arabi’s
rescue and his safe delivery at almost any point that might be
designated.
“It is good,” he replied, slowly and impressively. “Egypt will be free.”
Profoundly wishing that the noble little “Leckwith” was at my service
instead of at the bottom of the sea, I added that I had no ship and it
would be necessary to purchase one, as it would be impracticable to
charter a vessel for such a purpose. This meant that the expedition
would require some financing, in addition to the charge for my
services. With a gesture which indicated that everything was settled
in his mind and that it was only necessary for me to name my terms
to have them agreed to, Regal said he anticipated no difficulty on
that point and suggested that I return the next afternoon or evening
to meet his associates, who comprised the inner circle of the
revolutionary party. I told him I would be glad to come at any hour
but I doubted that I could find my way through the labyrinth of
narrow streets.
“How has the person who guided you here conducted herself?” he
asked.
“Irreproachably.”
“She will signal you to-morrow afternoon or evening. Follow her.”
With that he arose, terminating the interview; we solemnly shook
hands and he escorted me to the door. I was wondering how I
should find the way back to my hotel when I descried Ialla and her
four shadows waiting for me a short distance down the street.
Without a word they showed me the course until I made out the
hotel, when they disappeared down a side street.
I was lounging in the garden early the next afternoon, for there was
no telling when the summons might come and I would take no
chance of missing it. It was about four o’clock, at which hour all
Cairo was on parade and the crowd was thickest around the hotel,
that Ialla and her faithful female guards entered the lively scene. Her
face was almost entirely hidden by her veil but there was no
mistaking her eyes. They caught mine and a quick little beckoning
motion, which no one else would have noticed, told me to follow her.
She soon left, walking slowly, and I took up the trail, restraining
myself with an effort from approaching her more closely than
wisdom dictated. Avoiding the crowded Mooshka they led me, by a
more circuitous route, back to the house where I had been so
agreeably entertained the night before, and which was entered in
the same way. Regal was waiting for me and with him were five of
his countrymen, to whom I was introduced en bloc. They were
dignified and reserved but sharp-eyed and vigorous and they looked
like fighters of the first water. They were much younger than Regal
and evidently, from the deference shown him, he was the chief
conspirator.
“These,” he said, with a courtly wave of his hand toward the others,
“are the relatives and companions-in-arms of Arabi Pasha and the
men who, with me, are directing our operations. They are perfectly
responsible, as you will see, and in every way entitled to your
confidence, as you are worthy of theirs.”
With this formal assurance we sat down to a detailed discussion of
the project. They told me of their plans, as Regal had previously
explained them in a general way, and professed confidence that with
Arabi in personal command of their forces, and with the active
coöperation of the Soudanese, which was assured, they would drive
the hated British out of Egypt, and keep them out. Their knowledge
of the surroundings at Arabi’s place of confinement and their plan for
overpowering his guards and securing his release, which was
complete to the slaughter of the last man, showed an intimate
acquaintance with conditions that surprised me. From all they told
me on this point I gained the idea that they were working in
harmony with their brother Mohammedans in India, and that the
latter were planning a similar uprising when the conditions were
judged to be opportune. Developments since then have
strengthened this belief into a conviction. It is never wise to predict,
but when England some day becomes involved in a war with a first-
class power, like Germany for instance, which will tax her fighting
forces to the limit, there need be no surprise if the natives of Egypt
and India rise simultaneously and become their own masters.
It was urged by them and agreed that I should take no part in the
actual rescue of Arabi but remain on the ship, to guard against any
surprise by water and to be ready to steam westward as soon as the
party returned. I was to stand in close to the shore just after dark,
with all lights doused, and it was thought that Arabi would be safe
on board long enough before sunrise so that we could be well clear
of the land by daylight. The point at which Arabi was to be landed
caused considerable discussion. As the British were certain to
promptly patrol the Red Sea, with all of the warships that could be
hurried into it, and closely guard the Strait of Bab-el-Mandeb, it was
tentatively decided that the safest and wisest course would be to put
him ashore near Jibuti, on friendly French soil, from which point he
could pick a pathway through Abyssinia and down the Nile, with little
danger of detection and with the advantage of being able to arouse
the enthusiasm of the Soudanese and other tribes through which he
passed. I was in favor of running the gantlet of the Strait and
landing him two or three hundred miles south of the Gulf of Suez,
which would expedite the revolt and also make things more exciting,
but the others feared this would expose him too much to the danger
of recapture. They were for the surest way and said that more
reckless methods could wait until he was at the head of his troops.
This conclusion as to the landing place, however, was not final. It
was understood that I would receive definite instructions when I put
in at Saukin, on the way out, to take on the fifty proud and trusted
warriors who were to effect the release of their revered leader.
The fact that consideration of terms was the last question brought
up was a delicate compliment to my supposed fairness which I
appreciated. Instead of asking them for fifty thousand pounds, as I
had intended to, I stipulated only forty thousand, one-half of which
was to be advanced to me for the purchase of a suitable ship. The
ship was, of course, to be turned over to them at the conclusion of
the expedition. I was to pay all expenses and collect the remaining
twenty thousand pounds after Arabi had been landed. If they had
fixed the terms themselves they could not have agreed to them
more readily, and I was asked to return at ten o’clock the next
evening for the initial payment.
Our negotiations thus rapidly concluded, I was invited to remain to
dinner, which is the crowning honor of Egyptian confidence and
hospitality. I needed no urging and never have I enjoyed a meal
more. The table-talk was general, but running all through it was the
love of freedom and the plan through which they hoped to realize
their passion. Their interest in American affairs was only that called
for by courtesy, but they made me tell many stories of our wars with
England, from which they derived much satisfaction.
“We are as much entitled to our freedom as you are,” declared one
of my hosts, whose green turban indicated that he could trace his
ancestry back to Mahomet, “and we will win ours in the end, just as
your people won theirs. We may be a strange people,” he added,
reflectively, “but we are not so bad as we have been painted. The
howadji [strangers] condemn our religion without understanding it
and preach to us another, which, so far as we can observe from its
practices, falls far short of our own. Mohammedanism needs no
defence from me, but I will tell you just one thing about it. If you
were now to murder my brother I could not lay hands on you or
harm you, for you have eaten of my salt, but not even Mahomet
could make me cease to hate you in my heart. Does the Christian
religion, of which the British are so proud, teach you that?”
I confessed that it didn’t, so far as I had information or belief, and
made my sincere salaams to his faith. If I am ever to become
afflicted with any religious beliefs, I hope they will be those taught
by Mahomet.
When I finally started back to my hotel Ialla and her attendants
were waiting for me in the alley, for it was not wide enough to be
called a street. They started on ahead, but we had gone only a few
short blocks when her four companions walked briskly away and she
waited for me, in a shadow so deep that I at first thought she had
entered one of the queer houses and my spirits fell, to be revivified
a moment later when I almost ran into her.
“How did your business turn out?” she inquired anxiously, as I
bowed low before her. Her voice, which I had been longing to hear,
was soft and clear, as well became her, and her radiant beauty shone
forth through the darkness.
“Thanks to your cleverness,” I replied, “it has turned out well.”
“Then you are going to rescue my uncle,” she exclaimed delightedly.
Her sparkling eyes flamed with excitement and, as if to seal the
compact, she extended her hand, which I first pressed and then
kissed. Then I slipped it through my arm and started to walk out of
the shadow into the moonlight, and she accompanied me without
protest.
She had exchanged her cotton robe for one of silk, which was much
more fitting, and as I looked down on her I thought her the most
beautiful woman I had ever seen. If I had held the same opinion as
to others of her sex I was not reminded of it then, and there was no
manner of doubt that I was deeply in love with her. We walked long
and talked much, and some of it was interesting. She told me,
though it did not need the telling, that she was a lady and that she
had risked her reputation and exposed herself to coarsest insult by
appearing in public unveiled and dressed as a servant, out of love for
her uncle and devotion to his cause. To prevent suspicion it had
been determined that communication should be opened with me
through a woman, and she had volunteered for the service. She said
she had seen me at the Khedive’s reception, which she had
witnessed through the fretwork from the apartments of the Khedivah
—from which it appeared that I had been under consideration by the
revolutionary leaders for several weeks before I was approached—
and so she knew the man to whom the introductory note was to be
delivered. The two women servants, who could not be trusted with
such confidential correspondence, accompanied her for the double
purpose of protecting her as much as possible and carrying out the
peddling pretence. This explained why she had kept in the
background and covered her face with her scraggly veil most of the
time. On her first visit, she said, she had fully exposed her face so
that I might see she was not of the class of her companions and be
the more willing to hold commercial converse with her; in her heart
she knew her beauty would attract me, wherein she displayed an
abundantly justifiable confidence in her charms, but she expressed it
without the words or style of vanity. Except for that brief period
when she was altogether unveiled she said she really did not have
great fear of being discovered, for it was unlikely that any of her
friends would be around the hotel at the hours when she went
there, and, even if they did see her, it was improbable that they
would recognize her in fellahin attire. As a matter of fact, she
confessed, as we became better acquainted, she had entered into
the plot not only through love for her distinguished uncle, to whom
she was devoted, but from a liking for doing things that were out of
the ordinary.
It was this same spirit which induced her, on the night of my first
opportunity to tell her of her beauty and my fervid love for her, to
bribe her servants to disappear for a time. By the light of the
Egyptian moon, which would inspire even a lout of a lover, I told her,
in words that burned, of the passion she had implanted within me by
the first glance of her wonderful eyes, and I was encouraged by the
fact that she seemed more sympathetic than otherwise. We walked
for hours through deserted streets that were far from lonely until at
last we came to a corner near the hotel where her attendants were
waiting for her, patiently, I presumed, from their natures, but
whether patiently or not was of no concern to me.
The next night I found my way alone to Regal’s abode and received
the first payment of twenty thousand pounds, in Paris exchange.
There was a final conference, at which all of the details were gone
over again as a precaution against any misunderstanding, and I took
my departure with many good wishes. Ialla and her two women
attendants were waiting for me, as had been arranged, and my love-
making was resumed where I had left off on the preceding night.
Ialla was more responsive than before, but when I urged her to go
with me to France or marry me at once in Cairo she would not listen.
Finally she said: “After you have rescued my uncle I will go with you
anywhere, but not until then will I think of marriage.”
Nothing could move her from that decision. I arranged to meet her
the next night and the one following, and several others, which she
accomplished by the popular method of bribing her attendants, but,
though it was a joy to her to be told of my love there was no way by
which she could be induced to yield to it until her uncle was free.
Finally she regretfully insisted that I must leave, for her relatives,
she said, were becoming seriously disturbed over the fact that I had
remained so long in Cairo, instead of going about the important
business at hand. In my infatuation I had forgotten discretion and
my promise to conduct the expedition with all possible speed. Even
when this was brought home to me it required all of my will power
to say au revoir to the beauteous Ialla, though I expected to see her
soon again and hold her to her promise.
I went to Marseilles and called on a huissier d’marine, or ship broker,
named Oliviera, to whom I had been recommended. After looking
over several ships that were for sale I bought “L’Hirondelle” (The
Swallow), a coasting steamer of eight hundred tons that had been
running between Marseilles and Citta Vecchia, the port of Rome. She
was old but in good condition and could do seventeen knots or
better. I took command of the ship and my first and second officers
were Leigh and Wilson, who came down from London in response to
a telegram, bringing with them half a dozen men whom I knew
could be trusted. The crew was filled out with Frenchmen and we
headed for Suakin, far down on the Egyptian side of the Red Sea.
There I was to receive final instructions and pick up the Arabs who
were to do the manual labor, and whatever assassination was
necessary, in connection with Arabi’s restoration to his countrymen.
As soon as we were in the Red Sea I stripped off the ship’s French
name, rechristened her the “Adventure,” hoisted the British flag over
her, and gave her a forged set of papers in keeping with her name
and nationality.
At Suakin one of the great surprises of my life awaited me. We had
scarcely tied up when the man from whom I was to receive the
warriors came aboard with a letter from Regal directing me to turn
the ship over to him and discharge the crew. The agent could not
understand the change of plan any more than I could, and I could
not even guess as to the cause, but he was there to obey orders and
there was nothing else for me to do. I could not make any kind of a
formal protest without revealing something concerning my mission,
which I would not do, and, besides that, the ship did not belong to
me. Feeling sure there would be a satisfactory explanation waiting
for me at Cairo I returned there, after paying off the crew and
sending them back to Marseilles and London in charge of Leigh and
Wilson.
I was still more mystified when, on reaching Cairo, I was unable to
find Regal, Ialla, or any one else connected with the undertaking,
nor could I get the slightest trace of them. I located the house in
which I had been so charmingly admitted into the conspiracy, but
the people living there were strangers, so far as I was permitted to
observe or could ascertain, and they insisted they knew nothing at
all concerning the previous occupants. If I could have searched the
house I might have found out differently, but that was out of the
question. Here was Egyptian mystery beyond what I had bargained
for. It was as though I had been roughly awakened from a
delightfully realistic dream. The only theory on which I could explain
the puzzle was that the government had in some way learned of the
plot, in consequence of which every one identified with it had
disappeared, leaving it to me to take the hint and do likewise. In the
hope of seeing Ialla again and determined to secure some definite
clue as to just what had happened in my absence, I waited around
for two weeks or more, until I encountered the old friend who, I
knew, was responsible for my connection with the conspiracy. I did
not dissemble, as I had before, but took him to my room, told him
the riddle, and asked him the answer. I did not expect him to admit
anything and was not disappointed. What he said, in substance, was
this: “Of course I know nothing about the plot of which you have
told me. If what you say is true I should say that you have been
making something of a fool of yourself over this Ialla and that you
have only yourself to blame for the abrupt ending which seems to
have been reached. You are very shrewd and far-sighted and I will
admit that ordinarily you are not much moved by sentiment, but this
black-eyed beauty seems to have carried you off your feet. These
women are the greatest flirts in the world. There is nothing they
enjoy so much as clandestine meetings at which they can listen to
passionate protestations of love, and when these come from a
foreigner their cup of happiness is full. You thought Ialla was in love
with you, but she was only having a good time with you, and she
has taken a lot of pride in telling her friends about your meetings at
their afternoon gatherings in the old cemetery for the exchange of
gossip. She had no idea of marrying you, an unbeliever, you may be
sure of that. It may be that she thought she was stimulating you to
deeds of heroism in the rescue of her uncle, but, if she considered
that at all, it was a secondary matter. The men you were dealing
with have the contempt of their race for all women. They cannot
understand how any man can become so enamoured of a woman,
no matter how beautiful, as to let it interfere with his business.
When a man who, for the time being, has the leading role in a
prospective revolution, so far forgets himself as to waste a week of
valuable time in running after a flirtatious female they are quite likely
to conclude that he is too foolish and reckless to be trusted with
such an important matter. They would argue that no man who could
be relied on to carry out their plan would display such lack of
judgment. It is possible that there may be some other reason for the
situation in which you find yourself, but I doubt it. The wisest course
for you is to tell me how you can be reached, and leave Cairo, for
you can gain nothing by staying here. It is known to many persons
that I know you and if any one should want to get in communication
with you, I will be able to tell him how to do it.”
Possessing all the pride of a full-blooded man, I resented the calm
assertion that I had been ensnared by a flirt, and a somewhat
acrimonious argument followed, but, in looking back at it now, I am
willing to admit that probably my friend was right about it. Perhaps
Ialla was not, after all, the perfect woman that, under the magic
spell of her marvellous beauty, I imagined her to be, and possibly if I
had not surrendered so suddenly to her charms Arabi Pasha might
have been freed and Egypt might now be an Empire. Whether or not
that is true, I have no regrets on the subject, except that I never
saw Ialla again. My moonlight meetings with her were, at least, a
diversion, and they gave me great enjoyment while they lasted.
Though it went against the grain I was compelled to admit that my
friend’s advice was the best I could get, and I reluctantly followed it.
Feeling that for once my destiny had played it a bit low down on me
I crossed the Mediterranean and took a French liner for New York. I
had spent four months and much money in studying the Sphinx, but
I did not count them as lost. Ialla’s loveliness was in my mind for a
long time and while it remained I cherished the hope that I would be
recalled to carry out the plan for the rescue of her uncle, but the
summons never came. Eleven years later Arabi was pardoned and
returned to Egypt, but his influence among his own people was
gone; the fact that he had accepted a pardon implied, to their astute
minds, a secret agreement with their enemies and caused him to be
regarded as a tool of the British. But, as very recent events have
demonstrated, the fires of freedom are still burning, and now and
again signal smoke is seen rising over India.
CHAPTER XIV
RAPID-FIRE REVOLTS

THE friendliness of Fate, in throwing me in the way of adventures


which were beyond my discernment, was never more plainly
evidenced than on my return to New York from Australia and Egypt
in 1890. On the trip across the Atlantic my mind had wandered away
from the West Indies and I experienced an increasing desire to
return to South America, but one of the first things I heard on my
arrival was that my old friend Guzman Blanco had finally been shorn
of his supreme power in Venezuela only a few months before. He
had been betrayed by his friends, after the established fashion of
that captivating country, and Dr. Anduesa Palacio, one of his enemies
of years, had been made President with the approval and assistance
of Dr. Rojas Paul, the dummy whom Guzman had left as titular head
of the government while he was revelling in Paris, his foreign capital.
This discouraged me for a time in my half-formed plan to return to
my Southern stamping ground, and as I had plenty of money and
was not averse to a rest, I concluded to wait around, Micawber like,
for something to turn up. But it was not long until a silent voice
began calling me to South America; softly, at first, and then so
loudly that it came as a command. I had heard the same sort of an
order before, and only very recently, and was not disposed to
disregard it. I felt sure it would not lead me into disappointment
twice in succession.
Without knowing where or how the cruise would end, but confident
it would lead to trouble—though I did not imagine how much of it
there really would be or how unpleasant it would prove—I bought
the “Alice Ada,” a brigantine of three hundred tons, laid her on with
Thos. Norton & Sons, and got a general cargo for Rosario, Brazil, on
the River Parava. From Rosario I went one hundred miles up the
river to St. Stephens and took on a cargo of wheat for Rio Janiero.
As soon as I had looked around a little in Rio, while the cargo was
being unloaded, I understood why I had gone there, for my
expectant eye distinguished signs of a nice little revolution which
was just being shaped up. These indications, though somewhat
vague to even an experienced new arrival, were so encouraging in
their promise of exciting events that I sold my ship and took
quarters at the Hotel Freitas to watch developments. I had not long
to wait before the young republic celebrated its first revolution, but it
was accomplished in such a disgracefully quiet way, and in such
marked contrast with that sort of proceeding in Venezuela, and in
Central America and the West Indies, that I was thoroughly
disgusted with the country and was tempted to move on again into
new fields. A land in which the government is changed by the force
of public sentiment alone, and without the booming of cannon and
the bursting of bombs, has no charm for me.
When the last Emperor of Brazil, Dom Pedro II, was dragged out of
bed at night and deported without the firing of a shot, in the
“Peaceful Revolution” of November 15, 1889, Deodoro da Fonseca
was made President by the lovers of liberty and equality, which
purely imaginary conditions of life never will be found in any country.
Before his weakness had become apparent he was made
Constitutional President and Floriano Peixotto was elected Vice-
President. Deodoro had neither the firmness nor the initiative that
the situation demanded. His policy was weak and vacillating and his
popularity waned rapidly. The revolution which was in the process of
formation when I arrived on the scene was, I discovered, being
quietly fomented by Floriano, the Vice-President. He soon had the
army at his back and, as the people were beginning to clamor for
him, it was an easy matter to gain the support of Admiral Mello, the
ranking officer of the Brazilian Navy, and Admiral Soldanha da Gama,
commandant of the naval academy. They brought matters to a head
on the morning of November 23, 1891. Mello took up a position at
the foot of the main street of Rio in the cruiser “Riachuelo,” the
finest ship in the navy, trained his guns on the palace of Itumary,
and sent word to Deodoro that he would open fire on him in two
hours if he did not abdicate in favor of Floriano. Deodoro abdicated
in two minutes, and dropped dead soon afterward from heart
disease, and Floriano was proclaimed President.
Before he had time to get his new chair well warmed he had a row
with Mello, and as soon as I heard of it I foresaw another revolution,
which pleasing prospect prompted me to remain in Brazil, for I did
not believe it could possibly prove as uninteresting as those that had
preceded it. Mello regarded himself as the President-maker and
considered that he was rightfully entitled to be the power behind the
throne. However, Floriano was not at all constituted for the role of a
mere figurehead and he made it plain to Mello that while he might
make courteous suggestions and even give friendly advice, he could
not go an inch beyond that. Floriano was really a remarkable man.
He was perhaps one-half Indian and the rest corrupted Portuguese;
sixty years old, with clear, brown eyes and iron gray hair and
whiskers. A strong, fine character he was; perfectly fearless,
absolutely honest and devoted to his country, whose interests he
greatly advanced. He was proud of his Indian blood, which he made
a synonyme for courage and fairness, and often referred to it. He
was the best President I have ever known, not excepting even the
great Guzman.
Mello was a younger man and more of a Spaniard in his blood and
his characteristics. He had considerable bravery, of the kind that is
best displayed in the presence of a large audience, but he was
impetuous and at times foolish. He was abnormally ambitious and
believed in a rule or ruin policy. At that, he was more a man after my
own heart, for he stood for revolt and anarchy, while Floriano stood
for law and order. Soldanha da Gama, the third figure in the drama,
was a strange mixture of naval ability, cowardice, and theatrical
bravery.
When Floriano refused to be dictated to or even influenced in his
views as to what was best for Brazil, Mello proceeded to plot against
him with even more earnestness than he had displayed in the plans
to overthrow Deodoro. He worked chiefly among the naval officers,
the aristocrats, the adherents of Dom Pedro, and the Catholic clergy,
and in the end they all became his allies. He was unable to shake
the army, though he tried repeatedly to create dissatisfaction among
the troops, and the influence of the priests was minimized by the
fact that the people generally were blindly in love with the new
scheme of self-government, which sounded well and appealed
strongly to their sentimental natures, and were loyal to Floriano.
As Mello’s plot shaped up I began to suspect that his real purpose
was to restore Dom Pedro to the throne and make himself the power
behind it. Mello cared nothing for titles; it was his ambition to be the
dictator of Brazil, with power as absolute as that which Guzman
Blanco had exercised for many years in Venezuela. It was natural for
him to suppose that if he reëstablished the Empire under its old
ruler, Dom Pedro would be so grateful to him, and to him alone, that
he would be thoroughly subservient to his influence. Later events
confirmed me not only in the belief that this was what was in Mello’s
mind, but that he had an understanding with Dom Pedro and,
through him, with several European rulers, who were keenly anxious
to see the “divine right of kings” perpetuated in South America.
Mello considered that the dictator to an Emperor would have more
power than the dictator to a President, and he may have even
dreamed that he would some day take the throne himself and
establish a new dynasty. Dom Pedro had issued a protest against his
deposition as soon as he reached Europe, in which all the princes of
Coburg joined, and was conducting an active campaign for his
restoration. It is interesting to note, in passing, that there is still a
pretender to the throne of Brazil. When Dom Pedro died he left his
lost crown to Donna Isabella, wife of Count D’Eu, a Bourbon prince.
She passed it over to her eldest son, Peter, when he became of age,
and only recently he transferred all of his shadowy rights and
prerogatives to his younger brother, Louis, who now considers
himself the rightful ruler of Brazil. The Old World has a way of
keeping up pretenderships that is almost as ridiculous as some of
the revolutions of the New World.
It was amusing to watch the development of Mello’s rebellion, which
continued through all of 1892 and the greater part of the following
year. One would have thought that two friendly leaders were
planning rival surprise parties, in which there was to be nothing
more serious than the throwing of confetti. Floriano, surrounded by
spies and assassins but also by many loyal and devoted friends,
knew perfectly well, from his own spies, what Mello was doing, but,
relying on his own strength and the public sentiment behind him, he
made no move to check him. On the other hand, Mello was well
aware that Floriano knew all that was going on, yet neither one gave
any outward sign of this knowledge, and when they were together
they appeared to be friends.
It was along in July or August, 1893, that I was delightedly dragged
into the mysterious muss, after a period of waiting that was long,
anxious, and expensive. Mello sent for me first and expressed a wish
that I go down to Santa Catharina Island, off the southern coast of
Brazil, and blow up the “Republica,” the one Brazilian warship whose
officers had remained loyal to Floriano, though finally, just before the
revolution was declared, they went over to Mello. With the exception
of Soldanha da Gama, who was neutral but whom he regarded as
more of a friend than an enemy, Mello had converted the rest of the
navy to his cause, but the “Republica” held out against him and he
wanted her put out of the way of doing him harm. He offered a cash
payment and a commission in the navy in return for her destruction,
but I could never get him down to definite terms or to a contract
that I would accept. We had several conferences, and, while we
were still negotiating, I received a call from one of Floriano’s aides,
who asked me to accompany him to the palace. He took me in the
rear entrance and up a back stairway to Floriano’s private sala
where, after presenting me, he left me, as I supposed, alone with
the President.
“I understand,” said Floriano, getting right down to business, “that
you were in Venezuela with President Guzman and that you have
had military training and experience.”
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like