PostgreSQL Server Programming 2nd Edition Usama Dar
PostgreSQL Server Programming 2nd Edition Usama Dar
PostgreSQL Server Programming 2nd Edition Usama Dar
Martyrs of Ireland - who kept the faith of St. Patrick.pptxMartin M Flynn
Public Health For The 21st Century 1st Edition Judy Orme Jane Powelltrjnesjnqg7801
A Case of Identity A Sociological Approach Fix.pptxIsmail868386
Ad
PostgreSQL Server Programming 2nd Edition Usama Dar
1. Visit https://ebookultra.com to download the full version and
explore more ebooks or textbooks
PostgreSQL Server Programming 2nd Edition Usama
Dar
_____ Click the link below to download _____
https://ebookultra.com/download/postgresql-server-
programming-2nd-edition-usama-dar/
Explore and download more ebooks or textbooks at ebookultra.com
2. Here are some recommended products that we believe you will be
interested in. You can click the link to download.
PostgreSQL 2nd Edition Korry Douglas
https://ebookultra.com/download/postgresql-2nd-edition-korry-douglas/
Professional SQL Server 2005 Programming Robert Vieira
https://ebookultra.com/download/professional-sql-
server-2005-programming-robert-vieira/
Beginning Databases with PostgreSQL From Novice to
Professional 2nd Edition Matthew
https://ebookultra.com/download/beginning-databases-with-postgresql-
from-novice-to-professional-2nd-edition-matthew/
PostgreSQL Cookbook 1st Edition Chitij Chauhan
https://ebookultra.com/download/postgresql-cookbook-1st-edition-
chitij-chauhan/
3. Learning PostgreSQL Create develop and manage relational
databases in real world applications using PostgreSQL 1st
Edition Juba
https://ebookultra.com/download/learning-postgresql-create-develop-
and-manage-relational-databases-in-real-world-applications-using-
postgresql-1st-edition-juba/
Programming Microsoft SQL Server 2000 with Microsoft
Visual Basic NET 1st edition Edition Rick Dobson
https://ebookultra.com/download/programming-microsoft-sql-
server-2000-with-microsoft-visual-basic-net-1st-edition-edition-rick-
dobson/
Building Bluetooth Low Energy Systems 1st Edition Muhammad
Usama Bin Aftab
https://ebookultra.com/download/building-bluetooth-low-energy-
systems-1st-edition-muhammad-usama-bin-aftab/
Computer Networks An Open Source Approach 1st Edition
Ying-Dar Lin
https://ebookultra.com/download/computer-networks-an-open-source-
approach-1st-edition-ying-dar-lin/
Server study guide 2nd ed Edition Brad Hryhoruk
https://ebookultra.com/download/server-study-guide-2nd-ed-edition-
brad-hryhoruk/
5. PostgreSQL Server Programming 2nd Edition Usama
Dar Digital Instant Download
Author(s): Usama Dar, Hannu Krosing, JimMlodgenski, Kirk Roybal
ISBN(s): 9781783980581, 1783980583
Edition: 2
File Details: PDF, 2.28 MB
Year: 2015
Language: english
9. Table of Contents
PostgreSQL Server Programming Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. What Is a PostgreSQL Server?
Why program in the server?
Using PL/pgSQL for integrity checks
About this book’s code examples
Switching to the expanded display
Moving beyond simple functions
Data comparisons using operators
Managing related data with triggers
Auditing changes
Data cleaning
10. Custom sort orders
Programming best practices
KISS – keep it simple stupid
DRY – don’t repeat yourself
YAGNI – you ain’t gonna need it
SOA – service-oriented architecture
Type extensibility
Caching
Wrapping up – why program in the server?
Performance
Ease of maintenance
Improved productivity
Simple ways to tighten security
Summary
2. Server Programming Environments
Cost of acquisition
Availability of developers
Licensing
Predictability
Community
Procedural languages
Third-party tools
Platform compatibility
Application design
Databases are considered harmful
Encapsulation
What does PostgreSQL offer?
Data locality
More basics
Transactions
General error reporting and error handling
11. User-defined functions
Other parameters
More control
Summary
3. Your First PL/pgSQL Function
Why PL/pgSQL?
The structure of a PL/pgSQL function
Accessing function arguments
Conditional expressions
Loops with counters
Statement termination
Looping through query results
PERFORM versus SELECT
Looping Through Arrays
Returning a record
Acting on the function’s results
Summary
4. Returning Structured Data
Sets and arrays
Returning sets
Returning a set of integers
Using a set returning function
Functions based on views
OUT parameters and records
OUT parameters
Returning records
Using RETURNS TABLE
Returning with no predefined structure
Returning SETOF ANY
Variadic argument lists
A summary of the RETURN SETOF variants
12. Returning cursors
Iterating over cursors returned from another function
Wrapping up of functions returning cursors
Other ways to work with structured data
Complex data types for the modern world – XML and JSON
XML data type and returning data as XML from functions
Returning data in the JSON format
Summary
5. PL/pgSQL Trigger Functions
Creating the trigger function
Creating the trigger
Working on a simple “Hey, I’m called” trigger
The audit trigger
Disallowing DELETE
Disallowing TRUNCATE
Modifying the NEW record
The timestamping trigger
The immutable fields trigger
Controlling when a trigger is called
Conditional triggers
Triggers on specific field changes
Visibility
Most importantly – use triggers cautiously!
Variables passed to the PL/pgSQL TRIGGER function
Summary
6. PostgreSQL Event Triggers
Use cases for creating event triggers
Creating event triggers
Creating an audit trail
Preventing schema changes
A roadmap of event triggers
13. Summary
7. Debugging PL/pgSQL
Manual debugging with RAISE NOTICE
Throwing exceptions
Logging to a file
The advantages of RAISE NOTICE
The disadvantages of RAISE NOTICE
Visual debugging
Installing the debugger
Installing the debugger from the source
Installing pgAdmin3
Using the debugger
The advantages of the debugger
The disadvantages of the debugger
Summary
8. Using Unrestricted Languages
Are untrusted languages inferior to trusted ones?
Can you use untrusted languages for important functions?
Will untrusted languages corrupt the database?
Why untrusted?
Why PL/Python?
Quick introduction to PL/Python
A minimal PL/Python function
Data type conversions
Writing simple functions in PL/Python
A simple function
Functions returning a record
Table functions
Running queries in the database
Running simple queries
Using prepared queries
14. Caching prepared queries
Writing trigger functions in PL/Python
Exploring the inputs of a trigger
A log trigger
Constructing queries
Handling exceptions
Atomicity in Python
Debugging PL/Python
Using plpy.notice() to track the function’s progress
Using assert
Redirecting sys.stdout and sys.stderr
Thinking out of the “SQL database server” box
Generating thumbnails when saving images
Sending an e-mail
Listing directory contents
Summary
9. Writing Advanced Functions in C
The simplest C function – return (a + b)
add_func.c
Version 0 call conventions
Makefile
CREATE FUNCTION add(int, int)
add_func.sql.in
Summary for writing a C function
Adding functionality to add(int, int)
Smart handling of NULL arguments
Working with any number of arguments
Basic guidelines for writing C code
Memory allocation
Use palloc() and pfree()
Zero-fill the structures
15. Include files
Public symbol names
Error reporting from C functions
“Error” states that are not errors
When are messages sent to the client?
Running queries and calling PostgreSQL functions
A sample C function using SPI
Visibility of data changes
More info on SPI_* functions
Handling records as arguments or returned values
Returning a single tuple of a complex type
Extracting fields from an argument tuple
Constructing a return tuple
Interlude – what is Datum?
Returning a set of records
Fast capturing of database changes
Doing something at commit/rollback
Synchronizing between backends
Writing functions in C++
Additional resources for C
Summary
10. Scaling Your Database with PL/Proxy
Creating a simple single-server chat
Dealing with success – splitting tables over multiple databases
What expansion plans work and when?
Moving to a bigger server
Master-slave replication – moving reads to slave
Multimaster replication
Data partitioning across multiple servers
Splitting the data
PL/Proxy – the partitioning language
16. Installing PL/Proxy
The PL/Proxy language syntax
CONNECT, CLUSTER, and RUN ON
SELECT and TARGET
SPLIT – distributing array elements over several partitions
The distribution of data
Configuring the PL/Proxy cluster using functions
Configuring the PL/Proxy cluster using SQL/MED
Moving data from the single to the partitioned database
Connection Pooling
Summary
11. PL/Perl – Perl Procedural Language
When to use PL/Perl
Installing PL/Perl
A simple PL/Perl function
Passing and returning non-scalar types
Writing PL/Perl triggers
Untrusted Perl
Summary
12. PL/Tcl – Tcl Procedural Language
Installing PL/Tcl
A simple PL/Tcl function
Null checking with Strict functions
The parameter format
Passing and returning arrays
Passing composite-type arguments
Accessing databases
Writing PL/Tcl triggers
Untrusted Tcl
Summary
13. Publishing Your Code as PostgreSQL Extensions
17. When to create an extension
Unpackaged extensions
Extension versions
The .control file
Building an extension
Installing an extension
Viewing extensions
Publishing your extension
Introduction to PostgreSQL Extension Network
Signing up to publish your extension
Creating an extension project the easy way
Providing the metadata about the extension
Writing your extension code
Creating the package
Submitting the package to PGXN
Installing an extension from PGXN
Summary
14. PostgreSQL as an Extensible RDBMS
What can’t be extended?
Creating a new operator
Overloading an operator
Optimizing operators
COMMUTATOR
NEGATOR
Creating index access methods
Creating user-defined aggregates
Using foreign data wrappers
Summary
Index
27. “Young men and young maidens, old men and women, should visit
them and be inspired. I think there is as much merit in beautiful
manners as in hard work. I will not prejudge them successful. They
look well in July; we will see them in December. I know they are
better for themselves than as partners. One can easily see that they
have yet to settle several things. Their saying that things are clear,
and they sane, does not make them so. If they will in very deed be
lovers, and not selfish; if they will serve the town of Harvard, and
make their neighbors feel them as benefactors wherever they touch
them,—they are as safe as the sun.”
Mr. Sanborn, referring to the remark, “We will see them in
December,” says: “This passage indicates that Emerson with his fatal
gift of perception had long since seen the incongruity between Alcott
and Lane. At this time all was still fair weather at the Fruitlands
Eden, although the burden of too much labor, of which Lane had
written to Thoreau in June, had been falling more and more heavily
on Mrs. Alcott and her daughters, Anna, then twelve, and Louisa,
not quite eleven. As they did so much of the domestic drudgery, Mrs.
Alcott doubtless thought it no more than right that her English
guests, both there and at Concord, during the seven months that
Lane and his son were in their household, should pay their share of
the family expenses.”
The house at times was very overcrowded and the children had their
beds up in the garret. But Anna begged hard for a tiny room
adjoining Mrs. Alcott’s, and great was the joy she took in it. Of
course it all was very primitive. The men bathed in the brook in the
early morning and the shower-baths that Anna speaks of in her diary
were accomplished thus:—rough clothes-horses covered with sheets
were put in a circle and the bathers stood hidden within, while Mr.
Alcott, mounted on some wooden steps, poured water from a pitcher
through a sieve on their head. (This was told the author by an old
lady who when very young went to visit the children.)
28. Hired laborers and beasts of burden were against the principles of
the Community, but in order to make headway against the advancing
season they seemed to be a necessity. This concession, however,
troubled the philosophers, and it was decided to carry out the
original plan and rely wholly on the spade instead of the plough,
even at a cost of valuable time. The results were rather disastrous:
Charles Lane’s hands became sore and painful, and lame backs
seriously interfered with progress. Sobered by this new experience,
the philosophers met in conclave, and as a result Joseph Palmer,
who always came to the rescue in trying situations, went to No Town
and brought back his plough and yoke of oxen, as he called it—it
really was an ox and a cow which he had trained to work together.
Besides the outdoor work much writing was done indoors. Charles
Lane and Bower wrote prolifically to different papers. The Herald of
Freedom, the Vermont Telegraph and the New York Tribune of that
summer are full of their writings.
Mr. Alcott’s Diary furnishes clear evidence of his purposes and hopes:
—
“I would abstain from the fruits of oppression and blood, and am
seeking means of entire independence. This, were I not holden by
penury unjustly, would be possible. One miracle we have wrought
nevertheless, and shall soon work all of them: Our wine is water,
flesh, bread—drugs, fruits; and we defy meekly the satyrs all, and
Æsculapians. The Soul’s banquet is an art divine.... This Beast
named Man has yet most costly tastes, and must first be
transformed into a very Man, regenerate in appetite and desire,
before the earth shall be restored to fruitfulness, and redeemed from
the curse of his cupidity. Then shall the toils of the farm become
eloquent and invigorating leisures; Man shall grow his orchards and
plant his gardens—an husbandman truly, sowing and reaping in
hope, and a partaker in his hope. Labor will be attractive; life will not
be worn in anxious and indurating toils; it will be a scene of mixed
leisure, recreation, labor, culture. The soil, grateful then for man’s
generous usage, debauched no more by foul ordures, nor worn by
29. cupidities, shall recover its primeval virginity, bearing on its bosom
the standing bounties which a sober and liberal Providence ministers
to his heed—sweet and invigorating growths, for the health and
comfort of the grower.”
Mr. Sanborn, commenting on this, remarks:—
“It was in the spirit of the passages just quoted from Alcott’s diary ...
and not from the ordinary Fourieristic notions about attractions and
destinies and coöperative housekeeping that Alcott undertook his
experiment at ‘Fruitlands.’”
Alcott’s theory of human life was thus set down in his Diary:—
“I have been (as is ever the habit of my mind) striving to apprehend
the real in the seeming, to strip ideas of their adventitious phrases,
and behold them in their order and powers. I have sought to
penetrate the showy terrestrial to find the heavenly things; I have
tried to translate into ideas the language and images of spirit, and
thus to read God in his works. The outward I have seen as the
visible type of the inward. Ever doth this same nature double its
divine form, and stand forth—now before the inner, now before the
outer sense of man—at once substance and form, image and idea,
so that God shall never slip wholly from consciousness of the Soul.
Faith apprehends his agency, even in the meanest and most
seemingly trivial act, whenever organ or matter undergo change of
function or mode of form,—Spirit being all in all. Amidst all tumults
and discomfitures, all errors and evils, Faith discerns the subtle bond
that marries opposite natures, clinging to that which holds all in
harmonious union. It unites opposites; it demolishes opposing
forces. It melts all solid and obstinate matters. It makes fluid the
material universe. It hopes even in despair, believes in the midst of
doubts, apprehends stability and order even in confusion and
anarchy, and, while all without is perturbed and wasting, it
possesses itself in quietude and repose within. It abides in the
unswerving, is mighty in the omnipotent, and enduring in the
30. eternal. The soul quickened by its agency, though borne on the
waves of the mutable and beset by the winds of error and the
storms of evil, shall ride securely under this directing hand to the
real and the true. In the midst of change, it shall remain unchanged.
For to such a faith is the divine order of God made known. All visible
things are but manifestations of this order. Nature, with all its
change, is but the activity of this power. It flows around and obeys
the invisible self-anchored spirit. Mutability to such a vision, is as the
eddy that spirit maketh around its own self-circling agency, revealing
alike in the smallest ripple and the mightiest surges the power that
stirreth at the centre.”
31. VI
FATHER HECKER’S DESCRIPTION OF
FRUITLANDS
[Isaac Thomas Hecker was born in New York in 1819. Two years
after his experience at Brook Farm and Fruitlands he entered the
Roman Catholic church, and in 1849 he was ordained a priest. Later
he founded the Paulist Fathers. He died in 1888. The following
extracts are taken from a contemporary record of his impressions
while in the socialistic community.]
“Fruitlands,” so called because fruit was to be the principal staple of
daily food, and to be cultivated on the farm, was a spot well chosen;
it was retired, breathing quiet and tranquillity. No neighboring
dwelling obstructed the view of Nature, and it lay some distance
even from a bypath road, in a delightful solitude. The house,
somewhat dilapidated, was on the slope of a slowly ascending hill;
stretched before it was a small valley under cultivation, with fields of
corn, potatoes, and meadow. In the distance loomed up on high
“Cheshire’s haughty hill,” Monadnoc. Such was the spot chosen by
men inspired to live a holier life, to bring Eden once more upon
earth. These men were impressed with the religiousness of their
enterprise. When the first load of hay was driven into the barn and
the first fork was about to be plunged into it, one of the family took
off his hat and said, “I take off my hat, not that I reverence the barn
more than other places, but because this is the first fruit of our
labor.” Then a few moments were given to silence, that holy thought
might be awakened.
32. July 7, 1843. Brook Farm.
I go to Mr. Alcott’s next Tuesday, if nothing happens. I have had
three pairs of coarse pants and a coat made for me. It is my
intention to commence work as soon as I get there. I will gradually
simplify my dress without making any sudden difference, although it
would be easier to make a radical and thorough change at once than
piece by piece. But this will be a lesson in patient perseverance to
me. All our difficulties should be looked at in such a light as to
improve and elevate our minds.
I can hardly prevent myself from saying how much I shall miss the
company of those I love and associate with here. But I must go. I
am called with a stronger voice. This is a different trial from any I
have ever had. I have never had that of leaving kindred, but now I
have that of leaving those whom I love from affinity. If I wished to
live a life the most gratifying to me, and in agreeable company, I
certainly would remain here. Here are refining amusements,
cultivated persons—and one whom I have not spoken of, one who is
too much to me to speak of, one who would leave all for me. Alas!
him I must leave to go.
ISAAC T. HECKER
33. “[In this final sentence, as it now stands in the diary and as we have
transcribed it, occurs one of those efforts of which we have spoken
to obliterate the traces of this early attachment. ‘Him’ was originally
written ‘her,’ but the r has been lengthened to an m, and the e
dotted, both with care which overshot their mark, by an almost
imperceptible hair’s breadth. If the nature of this attachment were
not so evident from other sources, we should have left such
passages unquoted; fearing lest they might be misunderstood. As it
is, the light they cast seems to us to throw up into fuller proportions
the kind and extent of the renunciations to which Isaac Hecker was
called before he had arrived at any clear view of the end to which
they tended.]”[9]
9. Walter Elliott’s Life of Father Hecker.
Fruitlands, July 12.
Last evening I arrived here. After tea I went out in the fields and
raked hay for an hour in company with the persons here. We
returned and had a conversation on clothing. Some very fine things
were said by Mr. Alcott and Mr. Lane. In most of their thoughts I
coincide; they are the same which of late have much occupied my
mind. Alcott said that “to Emerson the world was a lecture room, to
Brownson a rostrum.”
This morning after breakfast a conversation was held on Friendship
and its laws and conditions. Mr. Alcott places Innocence first;
Larned, Thoughtfulness; I, Seriousness; Lane, Fidelity.
July 13.
This morning after breakfast there was held a conversation on the
Highest Aim. Mr. Alcott said it was Integrity; I, Harmonic being;
Lane, Progressive being; Larned, Annihilation of self; Bower,
34. Repulsion of the evil in us. Then there was a confession of the
obstacles which prevent us from attaining the highest aim. Mine was
the doubt whether the light is light; not want of will to follow, or
light to see.
July 17.
I cannot understand what it is that leads me, or what I am after.
Being is incomprehensible. What shall I be led to? Is there a being
whom I may marry and who would be the means of opening my
eyes? Sometimes I think so, but it appears impossible. Why should
others tell me that it is so, and will be so, in an unconscious way, as
Larned did on Sunday last, and as others have done before him? Will
I be led home? It strikes me these people here, Alcott and Lane, will
be a great deal to me. I do not know but they may be what I am
looking for, or the answer to that in me which is asking.
Can I say it? I believe it should be said. Here I cannot end. They are
too near me; they do not awaken in me that sense of their high
superiority which would keep me here to be bettered, to be
elevated. They have much, very much. I desire Mr. Alcott’s strength
of self-denial, and the unselfishness of Mr. Lane in money matters.
In both these they are far my superior. I would be meek, humble,
and sit at their feet that I might be as they are. They do not
understand me, but if I am what my consciousness, my heart, lead
me to feel,—if I am not deceived,—why, then I can wait. Yes,
patiently wait. Is not this the first time since I have been here that I
have recovered myself? Do I not feel that I have something to
receive here, to add to, to increase my highest life, which I have
never felt anywhere else?
Is this sufficient to keep me here? If I can prophesy, I must say no. I
feel that it will not fill my capacity. Oh God! strengthen my
resolution. Let me not waver, and continue my life. But I am sinful.
Oh forgive my sins! what shall I do, O Lord! that they may be
35. blotted out? Lord could I only blot them out from my memory,
nothing would be too great or too much.
July 18.
I have thought of my family this afternoon, and the happiness and
love with which I might return to them. To leave them, to give up
the idea of living with them again.—Can I entertain that idea? Still, I
cannot conceive how I can engage in business, share the practices,
and indulge myself with the food and garmenture of our home and
city. To return home, were it possible for me, would most probably
not only stop my progress, but put me back. It is useless for me to
speculate upon my future. Put dependence on the spirit which leads
me, be faithful to it, work and leave results to God. If the question
should be asked me, whether I would give up my kindred and
business and follow out this spirit life, or return and enjoy them
both, I could not hesitate a moment, for they would not compare—
there would be no room for choice. What I do I must do, for it is not
I that do it; it is the spirit. What that spirit may be is a question I
cannot answer. What it leads me to do will be the only evidence of
its character. I feel as impersonal as a stranger to it. I ask who are
you? Where are you going to take me? Why me? Why not some one
else? Alas! I cry, who am I and what does this mean? And I am lost
in wonder.
Saturday, July 21.
Yesterday, after supper, a conversation took place between Mr.
Alcott, Mr. Lane, and myself; the subject was my position with
regard to my family, my duty, and my position here. Mr. Alcott asked
for my first impressions as regards the hinderances that I have
noted since coming here. I told him candidly they were:
First, his want of frankness; 2d, his disposition to separateness
rather than win co-operation with the aims in his own mind; 3d, his
36. family who prevent his immediate plans of reformation; 4th, the fact
that his place has very little fruit on it, when it was and is their
desire that fruit should be the principal part of their diet; 5th, my
fear that they have too decided tendency toward literature and
writing for the prosperity and success of their enterprise.
[From this on, the diary is full of questionings and unrest. Should he
return to his family and live as an ordinary man, or should he listen
to the urge of the spirit within and seek further for the light? These
and other questions pursued him night and day. Finally he came to a
conclusion.]
July 23.
I will go home, be true to the spirit with the help of God, and wait
for further light and strength.... I feel that I cannot live at this place
as I would. This is not the place for my soul.... My life is not theirs.
They have been the means of giving me much light on myself, but I
feel I would live and progress more in a different atmosphere.
[It is interesting to note that after his return home he continued the
diet which was used at Fruitlands. The account of his life states:
“One of the first noteworthy things revealed by the diary, which from
this time on was kept with less regularity than before,—is that Isaac
not only maintained his abstemious habits after his return, but
increased their vigor.”]
August 30.
If the past nine months or more are any evidence, I find that I can
live on very simple diet—grains, fruit, and nuts. I have just
commenced to eat the latter; I drink pure water. So far I have had
37. wheat ground and made into unleavened bread, but as soon as we
get in a new lot, I shall try it in the grain.
Hecker had evidently at this time a practical conviction of the truth
of a principle which, in after years, he repeated in the form of a
maxim of the Transcendentalists: “A gross feeder will never be a
central thinker.” It is a truth of the spiritual no less than of the
intellectual order. A little later we come upon the following profession
of a vegetarian faith:—
“Reasons for not eating animal food.
“It does not feed the spirit.
“It stimulates the propensities.
“It is taking animal life when the other kingdoms offer sufficient and
better increment. Slaughter strengthens the lower instincts. It is the
chief cause of the slavery of the kitchen.
“It generates in the body the diseases animals are subject to, and
encourages in man their bestiality.
“Its odor is offensive and its appearance unæsthetic.”
Mr. Alcott’s death in 1888 was the occasion of reminiscences from
Father Hecker, from which a few extracts are taken:—
“When did I first know him? Hard to remember. He was the head of
Fruitlands, as Ripley was of Brook Farm. They were entirely different
men. Diogenes and his tub would have been Alcott’s ideal if he had
carried it out. Ripley’s ideal would have been Epictetus. Ripley would
have taken with him the good things of this life. Alcott would have
rejected them all.”
“How did he receive you at Fruitlands?”
“Very kindly, but from mixed and selfish motives. I suspect he
wanted me because he thought I would bring money to the
Community. Lane was entirely unselfish.”
38. “Alcott was a man of great intellectual gifts or acquirements. His
knowledge came chiefly from experience and instinct. He had an
insinuating and persuasive way with him.”
“What if he had been a Catholic, and thoroughly sanctified?”
“He could have been nothing but a hermit like those of the fourth
century—he was naturally and constitutionally so odd. Emerson,
Alcott, and Thoreau were three consecrated cranks.”
Here also are two interesting passages from the “Life of Father
Hecker,” and a few memoranda of private conversations:—
“Somebody once described ‘Fruitlands’ as a place where Mr. Alcott
looked benign and talked philosophy, while Mrs. Alcott and the
children did the work. Still to look benign is a good deal for a man to
do persistently in an adverse world, indifferent for the most part to
the charms of ‘divine philosophy,’ and Mr. Alcott persevered in that
exercise until his latest day.”
“He was unquestionably one of those who like to sit upon a
platform,” wrote at the time of his death, one who knew Alcott well,
“and he may have liked to feel that his venerable aspect had the
effect of a benediction.” “But with this mild criticism, censure of him
is well-nigh exhausted.”
“Fruitlands was very different from Brook Farm—far more ascetic.”
“You didn’t like it?”
“Yes; but they did not begin to satisfy me. I said to them: If you had
the Eternal here, all right, I would be with you.”
“Had they no notion of hereafter?”
“No, nothing definite. Their idea was human perfection. They set out
to demonstrate what man can do in the way of the supremacy of the
spiritual over the animal; All right, I said, I agree with you fully. I
admire your asceticism; it is nothing new to me; I have practiced it a
39. long time myself. If you can get the Everlasting out of my mind, I’m
yours. But I know that I am going to live forever.”
“What did Mr. Alcott say when you left?”
“He went to Lane and said, ‘Well, Hecker has flunked out. He hadn’t
the courage to persevere. He’s a coward.’ But Lane said, ‘No; you’re
mistaken. Hecker is right. He wanted more than we had to give
him.’”
40. VII
ANNA ALCOTT’S DIARY AT FRUITLANDS
1843.
This morning I rose pretty early. After breakfast I read and wrote
stories. In the afternoon I wrote some letters, And the following ode
to Louisa:—
Louisa dear
With love sincere
Accept this little gift from me.
It is with pleasure
I send this treasure
And with it send much love to thee.
Sister dear
Never fear.
God will help you if you try.
Do not despair,
But always care
To be good and love to try.
June 6, 1843.
Having been busy helping arrange things for moving last Thursday,
we left Concordia later for Harvard. I walked part of the way, the
distance being 14 miles from Concord to Harvard. I felt sad at the
thought of leaving Concord and all my little friends, the birth-place
41. of Abba where I had spent many happy hours; but Father and
Mother and my dear sisters were going with me, and that would
make me happy anywhere, I think. We arrived at our new home late
in the afternoon. Our first load of furniture had come before us. We
found Christy, Wood Abraham, and William all here. Mother was well
pleased with the house. There is no beauty in the house itself, but to
look out on three sides, you can see mountains, hills, woods, and in
some places the Still River may be seen through the trees. At some
distance are the Shaker Villages. On the whole, I like the house very
well. After eating our supper we fixed our beds and went early to
bed. Having no time to put up the bedsteads, we slept on the floor
which made my back lame. Friday and Saturday in working and
arranging the house in order. To-day in the morning I cleared the
table and washed the dishes, being washing day. I washed with
Mother and got dinner. In the afternoon I sewed and read. I did not
do much this evening, for I went to bed when I had finished the
dishes. The men have been planting to-day corn, and cutting wood
and fixing round about the house out of doors.
Wednesday, 11.
I began my school to-day. We commenced by singing, “When the
day with rosy light.” It seemed so pleasant to sing with my sisters.
After singing I wrote my journal and the girls wrote in their books.
They then studied arithmetic lesson. I then gave them a recess,
after which they spelt, read and Louisa recited geography. At eleven
the school was dismissed. In the afternoon I sewed for my dolly and
took care of Abba, then all went to walk in the woods. It was quiet
and beautiful there and I felt a calmness in myself. The sun was
shining and the birds were singing in the branches of the high trees.
It was so beautiful it seemed as if God was near me. I made some
oak leaf wreaths, one for father and one for mother, and stuck
flowers in them. They looked very pretty indeed. Then we returned
from our walk and prepared for supper. In the evening I sang with
Christy, William, mother, and sisters.
42. Thursday, 8.
To-day I gave the children lessons this morning. In the afternoon I
wrote. Christy is going to teach me arithmetic and composition, and
the subject upon which I am to write is our plan of life. The part I
wrote on to-day was flesh-eating. I will write it in here.
ABBA MAY ALCOTT
43. LOUISA MAY ALCOTT
ANNA BRONSON ALCOTT
COMPOSITION
Life was given to the animals not
to be destroyed by men, but to
make them happy, and that they
might enjoy life. But men are not
satisfied with slaying the
innocent creatures, but they eat
them and so make their bodies of
flesh meat. O how many happy
lives have been destroyed and
how many loving families have
been separated to please an
unclean appetite of men! Why
were the fruits, berries and
vegetables given us if it was
intended that we should eat
flesh? I am sure it was not. We
enjoy the beautiful sights and
thoughts God has given us in
peace. Why not let them do the
same? We have souls to feel and
think with, and as they have not
the same power of thinking, they
should be allowed to live in
peace and not made to labour so
hard and be beaten so much.
Then to eat them! eat what has
had life and feeling to make the
body of the innocent animals! If
treated kindly, they would be
kind and tame and love men, but
as they now are abused and
44. cruelly treated they do not feel the feeling of “love” towards men.
Besides flesh is not clean food, and when there is beautiful juicy
fruits who can be a flesh-eater?
In the evening I sang again as I did last night.
Friday, 9.
After breakfast, it being my day for dishes, I cleared up the table. At
eleven I had my composition lesson. In the afternoon I sewed, read
and played. I sewed in the evening and went to bed early.
Saturday, 10.
This morning father and Mr. Lane went to visit the Shakers in
Harvard town. I did the chamber work and then worked and made
some bread for dinner, and prepared things ready for it. In the
afternoon I laid down, it being very warm out, and read in
“Devereux” which pleased me very well. It rained hard and steadily
for some time. Father and Mr. Lane returned late in the afternoon.
They brought home sweet things they had purchased of the
Shakers. We played out on the grounds a little while and then I read
and went to bed early.
Sunday, 11.
I read until 10 o’clock when we had reading. In the afternoon I read,
wrote and had my lessons with Christy. In the evening I received a
note from mother accompanied by a roll containing some wafers and
some note paper. It was as follows:—
Dear Anna:
45. I send you a little note paper and a few wafers. You have so much
to do lately that I cannot expect you to write often to me, but you
must not forget that this is a little duty of yours that gives me a
great deal of happiness. This last word reminds me of one of father’s
beautiful selections to-day.
“Happiness is like the bird
That broods above its nest
And feels beneath its folded wings
Life’s dearest and its best.”
I am sure I feel as if I could fold my arms around you all, and say
from my heart, “Here is my world within my embrace.” Let us try,
dear Anna, to make it a good and beautiful world,—that when we
are called to leave it we may be fit to join the good and beautiful of
another sphere.
All things proclaim
In the valley and plain
That God is near.
Hills, vales and brooks,
Sweet words and looks,
Cast out all fear.
Be the dove of our ark,
Dear Anna remark
You’re my eldest and best,
Now you know all the rest,
So farewell dear,
God is near,
No evil fear,
Be happy here.
Mother.
I love to receive letters from mother. She always writes me such
dear kind notes.
46. Monday, 12.
This morning mother baked. I read. Mrs. Lovejoy and Mrs. Willard
came here to see mother. In the afternoon I read and wrote, and
took a walk with the girls into the woods. In the evening I played
and had a shower bath, and then went to bed.
Tuesday, 13.
Mrs. Willard came here and helped mother wash to-day. I helped her
some. In the morning I took care of Abba and wrote some. In the
afternoon I played, studied, and worked. When Mrs. Willard went
home Louisa and I walked with her to learn the way to the house
where she lives, for as she took some sewing to do for mother, we
wanted to know the way there. We saw some young women
braiding straw hats. One of them did it very fast indeed. I think I
should like to know how to make hats. Their mother asked us to
come and see them (her name is Willard) and mother said we might
go. We rode home with Mr. Wyman. When we got here we found
two young ladies and a girl who came to see us. They soon went
home. I ate my supper and soon after it went to my bed.
Wednesday, 14.
I ironed to-day with mother, and read some. I have not very much to
say and so I will write a French fable. [Here a fable is written out in
very good French.]
Thursday, 15.
This morning I felt quite unwell, so I laid down and saw Louisa keep
school for Lizzie and Abba. I read in “Tales of a Traveller” most all
the morning. In the afternoon I had a composition lesson, and then
47. saw father and Abraham winnow some corn and some barley. I then
rode to the mill with him and took Abba with us. I never saw a mill
working before that I recollect. I sewed when I came home and in
the evening talked.
Friday, 16.
Uncle Christy went to Boston this morning. As I was running to bid
him good-bye my foot slipped and I fell down on my back. It hurt
me a good deal and I had a pain in my side. In the afternoon I went
to bed and read. When I got up I fainted. I went to my bed early.
Saturday, 24.
This was Lizzie’s birthday. I arose before five o’clock and went with
mother, William, and Louisa to the woods where we fixed a little pine
tree in the ground and hung up all the presents on it. I then made a
wreath for all of us of oak leaves. After breakfast we all, except
Abraham, marched to the wood. Mr. Lane took his fiddle with him
and we sang first. Then father read a parable, and then this ode
which he wrote himself. I will write it on the next page. Father then
asked me what flower I should give Lizzie on her birthday. I said a
rose, the emblem of Love and Purity. Father also chose a rose.
Louisa said a Lily-of-the-Valley, or innocence,—Mother said she
should give her a Forget-me-not, or remembrance. Christy said the
trailing Arbutus, the emblem of perseverance. Mr. Lane gave her a
piece of moss, or humility. Abba gave her a Wakerobin. I do not
know what that means. We then sang. Lizzie looked at her presents
and seemed much pleased. Mother gave her a silk thread balloon, I
a fan, Louisa a pin-cushion, William a book, Abba a little pitcher. Mr.
Lane wrote some lines of poetry which I will write in here:—
TO ELIZABETH
48. Of all the year the sunniest day
Appointed for thy birth
Is emblem of the longest stay
With us upon the earth.
Now dressed in flowers
The merry hours
Fill up the day and night.
May your whole life
Exempt from strife
Shine forth as calm and bright.
Fruitlands.
Here is father’s:—
BIRTHDAY ODE
I
49. Here in the grove
With those we love,
In the cool shade
Near mede and glade
With clover tints ore’laid—
A haunt which God ourselves have made—
The trees among
With leaves are hung.
On sylvan plat,
On forest mat,
Near meadow sweet
We take our seat,
While all around
Swells forth the sound
Our happy hearts repeat.
The wood and dell
Our joy to tell
The morning, and
Our peace to share,
Flows by his cool
A balmy school,
The Sun his fires
His kindled iris
Not yet inspires
In mid-noon blaze
His scorching rays,
But all is calm and fresh and clear
And all breathes peace around us here.
II
50. Wake, wake harmonious swell
Along this deep sequestered dell,
Along the grass and brake,
And where the cattle slake
Their thirst, when glides
Adown the sloping sides
In ceaseless frit
The wizard rivulet,
And let the spring maze
Join with violin note
In hymning forth our praise
From forth melodious throat
Our holy joy to tell.
III
Father’s here
And Mother dear
And sisters all,
The short and tall,
And Father’s friends
Whom Briton lends
To noblest human ends,
With younger arm
From Brooklet farm,
But absent now
At yonder plough
With shining, cleaving share
Upturning to the upper air
The obstinate soil,
The sober son of hardy toil.
IV
51. Here, here we all repair
Our hope and love to share,
To celebrate
In rustic state
Midst this refulgent whole
The joyful advent of an angel soul
That twice four years ago
Our mundane world to know
Descended from the upper skies
A presence to our veriest eyes
And now before us stands
And asketh at our bounteous hands
Some token of our zeal,
In her most holy weal
Before us stands arrayed
In garments of a maid.
Untainted and pure her soul
As when she left the whole
That doeth this marvelling scene
And day by day doth preach
The gospel meant for each
That on this solid sphere
For mortal’s ear.
V
52. Then take our tokens all
From great and small
And close that noblest treasure beat
That in your heart doth sleep.
Mind what the spirit saith
And plight therein thy faith,
My very dear Elizabeth,
Nor let the enemy wrest
The heavenly harvest from that field,
Nor tares permit to sow,
Nor hate, nor woe
In the pure soil God’s grace itself would sow;—
But bloom and open all the day
And be a flower that none shall pluck away,
A rose of Fruitland’s quiet dell,
A child intent on doing well
Devout secluded from all sin
Fragrance without and fair within
A plant matured in God’s device
An Amaranth in Paradise.
Monday, 17 July, 1843.
This morning, not feeling well, I did not join the singing class, but
kept my bed till after breakfast. We had no lessons to-day and I
sewed. I believe I will write a story called The May Morning.
53. A FABLE
The May Morning
Early one morning in May a father conducted his son Theodore into
the garden of a rich man which the boy had never yet seen. The
garden was situated at a distance from the city, and it was adorned
with all sorts of shrubs and plants, beds of flowers and fruit trees,
shady alleys and pleasant groves. Through the middle of the garden
wandered a pellucid stream which fell from a rock and formed a
large pool at its foot. In the cool dell the water turned a mill. In the
most beautiful spot in the garden were seats entwined with roses
and verdant bowers.
Theodore could not satiate his eyes with the charms of the place. He
walked beside his father mostly in silent amaze, but sometimes he
would exclaim: “O Father, how lovely and beautiful is this garden!”
When they had seen many things and were weary with their walk
the father conducted the boy through the plantations to the fall of a
stream and they sat down on the brow of a hill. Here they listened
to the roaring of the water which tumbled foaming from the ledge of
the rocks, and in the surrounding thickets were perched nightingales
which mingled their strains with the hoarse murmur of the fall. And
Theodore thought he never yet had heard nightingales sing so
delightfully. While they thus sat and listened they heard the voice of
a man and the voices of children. They were the children of the
miller, a boy and a girl, and they were leading their old blind
grandfather between them, and telling him about the beautiful
shrubs and flowers by the wayside, and amusing the old man by
their lively and simple prattle.
They conducted him to a seat in an arbor and kissed him, and ran
about the garden to gather flowers and fruit for him. But the old
man smiled, and when he was alone he uncovered his head and
54. prayed with a cheerful countenance. Then the hearts of Theodore
and his father overflowed, and they offered up prayer and praise
with the old man, and Theodore was overcome by his feelings so
that he could not repress his tears.
The children soon afterwards appeared, and they shouted from afar,
and they brought sweet-smelling flowers and ripe fruit to their blind
grandfather. But Theodore said to his father as they were returning
home, “O what a delightful, what a happy morning!”
THE FOUNTAIN
“The little fountain flows
So noiseless through the wood
The wanderer tastes repose
And from its silent flood
Learns meekly to do good.”
It’s short, but I thought it was very pretty.
Tuesday, 18.
This morning after doing my work I had lessons. I wrote some in my
journal and did some sums. In the afternoon I went blue-berrying
with Lizzie and picked nearly, if not quite, a quart. I read in the
evening.
Wednesday, 19.
We had a descriptive lesson this morning and each of us wrote a
description of Fruitlands.
I wrote the following one:—
55. “FRUITLANDS”
It is a beautiful place surrounded by hills, green fields and woods,
and Still River is at some distance flowing quietly along. Wachusett
and Monadoc Mountains are in sight, and also some houses and
fields of grain. The house itself is now very pleasantly situated. It
has a vegetable garden behind it and some fruit trees. On the left a
hill on the top of which are pastures and a road. In front is a small
garden, and fields and a house at some distance. On the right is a
large barn, grain and potato field, woods and mountains. There are
many pleasant walks about Fruitlands, and berry fields, though the
berries are not yet quite ripe.
It is a pleasant place to live in, I think.
THE COMMUNITY SETTLE
Thursday, 20.
56. I had my lesson this morning with Mr. Lane and I did some sums
with fractions. I never did any till Mr. Lane began to teach me, and I
think I have learned more lately than I ever did before. I think I
understand what I learn too. In the afternoon I had my shower bath
and sewed. Mrs. Lovejoy came here to see Mother and brought her
little baby with her. I took care of it a good deal. Charlotte and Ellen
Dudley came to see me and went to Mrs. Barnard’s of an errand with
me. I there became acquainted with Adelaide Barnard. We all went
into the schoolhouse and played together. In the evening I sewed a
little bit and then went to bed.
Sunday, 23.
I did not feel well this morning, so I did not attend the readings, but
read in Miss Edgeworth’s “Belinda.” In the afternoon I sewed some
and mother finished “Sowing and Reaping” aloud. I then went to
look for blueberries, but did not find but a very few. When I returned
I had supper and after that I read.
Monday, 24.
I had no lessons to-day, Mr. Lane being unwell and father busy.
Mother washed and Louisa and I helped her. I then shelled some
peas for dinner. Yesterday Christy went away. He will return
sometime I guess. In the afternoon I read part of “Mademoiselle
Panache.” I then wrote my journal and took care of Abba. William
and I then ironed till we went to supper. In the evening I looked for
berries and went pretty early to bed.
Tuesday, 25.
This morning I had lessons by myself. I did a French lesson and
wrote in my journal. I then sewed some. In the afternoon I made
57. some little presents to give Abba as to-morrow is her birthday. I then
raked hay. In the evening I read in “Motherless Ellen.”
Wednesday, 26.
Abba’s birthday. We did not do anything to celebrate except that I
put some presents into her stocking last night and she found them
there this morning. After breakfast father and Mr. Lane started for
Boston with Mr. Hecker. We had no lessons. I washed, and the three
other children went to a mill for a walk. I arranged a room for
myself. It is to be my room and I to stay by myself in it. I then set
the dinner table. The children did not return till after dinner. I had a
bath and then arranged some pictures for my scrap-book. As Mother
was going into the fields to help with the hay, I joined her, and after
working there some time went with Louisa to look for berries. We
found about a pint. In the evening I read in “Motherless Ellen” some
more.
I rose pretty early this morning and having bathed and dressed sat
down to write my journal. Having done so I went downstairs and eat
breakfast. After I had done I went with Louisa and William to pick
blackberries. We got about two quarts. When we returned I read
and then worked with William. In the afternoon I wrote and went to
Mrs. Lovejoy’s. I then had a bath and wrote, after which I read in
the newspapers. In the evening I played.
POETRY
58. 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!
ebookultra.com