Oldest recorded transaction

2025-09-0614:34181106avi.im

The oldest recorded transaction was in 3100 BC

The other day I posted a tweet with this image which I thought was funny:

tablet from Sumer

This is the oldest transaction database from 3100 BC - recording accounts of malt and barley groats. Considering this thing survived 5000 years (holy shit!) with zero downtime and has stronger durability guarantees than most databases today.

I call it rock solid durability.

This got me thinking, can I insert this date in today’s database? What is the oldest timestamp a database can support?

So I checked the top three databases: MySQL, Postgres, and SQLite:

MySQL1000 AD
Postgres4713 BC
SQLite4713 BC


Too bad you cannot use MySQL for this. Postgres and SQLite support the Julian calendar and the lowest date is Jan 01, 4713 BC:

sales=# INSERT INTO orders VALUES ('4713-01-01 BC'::date);
INSERT 0 1
sales=# SELECT * FROM orders;
 timestamp
---------------
 4713-01-01 BC
(1 row)
sales=# INSERT INTO orders VALUES ('4714-01-01 BC'::date);
ERROR: date out of range: "4714-01-01 BC"

I wonder how people store dates older than this. Maybe if I’m a British Museum manager, and I want to keep theft inventory details. How do I do it? As an epoch? Store it as text? Use some custom system? How do I get it to support all the custom operations that a typical TIMESTAMP supports?

Thanks to aku, happy_shady, Mr. Bhat, and General Bruh for reading an early draft of this post.

1. Source of the image: Sumer civilization
2. I found this from the talk 1000x: The Power of an Interface for Performance by Joran Dirk Greef, CEO of TigerBeetle, timestamped @ 38:10.
3. The talk has other bangers too, like this or this.


Read the original article

Comments

  • By delichon 2025-09-0615:464 reply

    This isn't just the oldest recorded transaction, it's nearly the oldest known recognizable sample of human writing. Not a love letter or a sermon or a story, but a receipt. This probably reflects their ubiquity rather than importance. There is one known older writing sample, the Kish Tablet of Jemet Nasr. Since that tablet represents lists and counts of goods (barley, oil, livestock), it may also be a receipt, or perhaps an inventory.

    The oldest known non-commercial writing is a set of proverbs from around 2600 BCE, Instructions of Shuruppak.

    With my luck my most cringe-worthy diary entries will probably last that long.

    • By ants_everywhere 2025-09-0619:302 reply

      One of the theories of how writing was invented was via transactions and accounting.

      You start keeping items in clay jars. You eventually mark the jars with a depiction of what's in it. Those marks begin standing in for the items themselves when communicating across languages or keeping records of how many items and jars you have.

      • By jeanlucas 2025-09-0712:091 reply

        Impossible to truly know. Writing may well have started with doodles, notes, even jokes on materials like leaves or wood that didn’t survive.

        What survives are the "important" texts because you would deliberately put them on durable material. That creates a bias where early writing looks purely transactional.

        Same reason we think of pyramids when we think of ancient architecture: stone lasts, wood doesn’t.

        • By ants_everywhere 2025-09-0714:321 reply

          That's true we don't know anything about markings that were made on organic materials.

          We do know that art and other markings date tens of thousands of years before the first proto-writing. Writing is specifically about markings that form a language. So doodles and visual jokes (e.g. phalluses) wouldn't count. I don't know what you mean by notes, but writing notes without a language would be difficult I suspect.

          But there could early languages that were written on organic materials. The main problem is there's a bootstrapping problem where you need to account for how the first one developed at all. After that you can continuously improve over time.

          • By jeanlucas 2025-09-0815:32

            Exactly, it's not a good theory, but it's the best one we have.

            We just need to keep in mind that and not word it as if it is a fact that writing stated with accounting

      • By tycho-newman 2025-09-0720:58

        Writing probably arose from reading animal tracks in soft mud.

    • By maratc 2025-09-0617:351 reply

      > Not a love letter or a sermon or a story, but a receipt. This probably reflects their ubiquity rather than importance.

      We humans are pretty good at remembering sermons and stories and we can recreate them from memory and pass them down to the next generations. We however suck at remembering numbers, that's why we invented writing so we could write the numbers down and rely on these records, instead of on bad human memory.

      • By lazide 2025-09-072:14

        Well, we especially suck at remembering numbers when it’s something like ‘how much I owe Bob’ hah. At least for many people.

        I expect this writing was a way to help reduce civil unrest/murder by reducing he said/she said arguments about goods, services, money, etc.

    • By ahmedfromtunis 2025-09-0618:291 reply

      That was not by (deliberate) choice.

      The earliest writings were actually logographic or semasiographic, meaning they represented ideas, objects, or concepts directly rather than the sounds of a specific spoken language.

      We actually don't know what language(s) was/were spoken by the people who recorded the earliest tablets (not sure if that also applies to this particular one, though).

      Phonographic writing developed much later and with it came all the forms of textual recordings we're familiar with.

      • By thaumasiotes 2025-09-0619:202 reply

        > Phonographic writing developed much later

        Well, the earliest signs are logographic.

        But phonographic writing didn't take long to develop. Once you've got a few logographs, it becomes apparent immediately that you can't extend that approach to everything you can say.

        • By dotancohen 2025-09-0619:412 reply

            > Once you've got a few logographs, it becomes apparent immediately that you can't extend that approach to everything you can say.
          
          The converse is just as true. Not all things you can think, you can say. I remember sometime in my teens realizing that my thoughts are constrained by my language, an epiphany that sparked a life long interest in language. Now some 30 years later, I feel that I can feel ideas that I don't know how to express, but not for lack of language. Rather, some ideas are too complex for our simple speech. Just as a dog would be unable to bark the idea "energy is neither created nor destroyed".

          • By smj-edison 2025-09-0621:231 reply

            Bit of a tangent, but have you followed dynamic land at all? Their whole thing is expressing ideas through a dynamic medium, to convey things we can't explain through speech. You might find it interesting :)

            https://dynamicland.org/

          • By deaddodo 2025-09-070:552 reply

            Do you have an example? I can’t possibly think of a single idea that’s completely expressionless. Even drug-fueled hallucinations can eventually be given a description; albeit without being able to actually transfer the feeling/internalization of it.

            You might have to be overly verbose and explicit in your language, but ultimately you can describe pretty much anything using “like”, “as”, and “akin to” with qualifiers.

            • By dotancohen 2025-09-071:36

              I think that any parent holding their baby for the first time will give an example. There is a feeling of existing, of purpose, of continuity. But no "like", "as", or "akin to" suffices.

        • By cyberax 2025-09-0620:003 reply

          > But phonographic writing didn't take long to develop.

          But it did. It took around 1500 years from the first writing systems to fully phonetic systems. And we still have Chinese characters even now, or the Tibetan writing system.

          For some reason, writing systems tend to stay stuck on mixed logographic and phonetic systems.

          • By OskarS 2025-09-0622:23

            There's always a sliding scale between "proto-writing" and fully developed writing systems, but just using symbols phonetically instead of semantically happens much faster than that. The very archaic forms of proto-cuneiform is from about 3400 BCE (though things like clay tokens are much older). It, like virtually all writing systems in the world, developed into a true writing system by use of the "rebus principle", where symbols came to acquire different meanings based on phonetics in the same way as in a rebus. Like, in English, if you had a symbol for "female sheep" (a "ewe"), you could start to use it to signify the word "you", even though there's no semantic connection.

            The earliest evidence for this in cuneiform is from around 3200-3000 BCE. There is a famous tablet where the symbol for "reed" is used to represent the word "reimburse", because they're both pronounced like gi. By a few hundred years later, cuneiform was a fully fledged phonetic writing system.

          • By thaumasiotes 2025-09-0621:321 reply

            The modern Chinese writing system is fully phonetic, just with extremely complex spelling. There is no pretense that characters represent ideas or words. They represent syllables.

            Phonetic use of the characters was immediate. The go-to example here is 來, which depicts a stalk of wheat. It is the spelling of the verb "come", and the verb is spelled that way because the character for "wheat" was borrowed with no alterations to represent its own pronunciation, which was shared with the verb.

            • By cyberax 2025-09-0623:531 reply

              I speak Chinese :)

              It's a mixed system with about 2 millennia of legacy. It started as logographic, then it got into phono-semantic compounds, with detours into the written-only official language (like Latin), and now it's messy mix of everything. There are true logographs (休,林,森), true phonosemantic compounds, and plenty purely phonetic characters that have no meaning by themselves ("bound morphemes").

              • By thaumasiotes 2025-09-070:041 reply

                > now it's messy mix of everything. There are true logographs

                Don't confuse the origin of the system with what the system is now.

                Using your example, what do you see as the difference between the "logographs" 森 and 林?

                Neither can be a logograph, because neither one represents a word. But even if that weren't the case, on the assumption that they are simply pictures representing concepts, how would you know which one was which?

                What does it mean, to you, that the word "forest" must be written 森林 and not 森?

                > and [there are] plenty purely phonetic characters that have no meaning by themselves ("bound morphemes").

                ...yes. 森 and 林 both belong to that category. But you've specifically contrasted them with it. I can't tell what you're thinking of.

                Characters can be classified by origin, so that 森 is "从林从木", 切 is "从刀七声", and 下 is "指事". You seem to be reaching for this, but "bound morpheme" is a classification of the current use of the linguistic element, not of the origin of the way it's spelled.

                • By kragen 2025-09-0710:561 reply

                  图样图森破

                  • By thaumasiotes 2025-09-0720:021 reply

                    I'm not sure I follow you, but it seems worth noting that those five characters are the transcription of an English phrase. (In this case, "森" is just the first half of the word "simple".)

                    • By kragen 2025-09-0722:39

                      In this case used purely for its phonetic value, with no semantic content, so it's hard to call it logographic.

          • By prewett 2025-09-071:351 reply

            My understanding of the history of Chinese writing is that it kept trying to go phonetic, but each time they prevented it, because the writing had to be read across an empire with multiple languages. Even so, something like 20% of the characters are quasi-phonetic, with the radical giving the topic and the rest of the character giving the approximate pronunciation, so "the word for {a plant|a thing of metal|a person|etc} that is sounds similar to X".

            When the Japanese imported it, they used the characters much more phonetically. They used the whole word when that worked, but the characters got assigned to the Japanese pronunciation of the word, as well as the pronunciation from the pieces of other words where that character appeared, as well as the Chinese pronunciations. Then six hundred years or so later they imported them again, by which point the characters had evolved in Chinese but not in Japanese. So its sort of phonetic, but it's a complete mess.

            • By kragen 2025-09-0710:431 reply

              That's mostly right.

              Not 20%, more like 90%. https://en.wikipedia.org/wiki/Chinese_character_classificati...

              In Japanese at this point most kanji have an onyomi (the sound of the Chinese word, which has been adopted into Chinese the way Latin words like "adopt" are adopted into English) and at least one kunyomi (the sound of a synonymous Japanese word not derived from Chinese). This does add difficulty but it is somewhat compensated for by the smaller repertoire of characters used in Japanese. A lot of the most common Japanese words, all loanwords from languages like English, and all the inflectional suffixes are normally written with one of two purely phonetic syllabaries.

              • By thaumasiotes 2025-09-0720:081 reply

                I would take issue with

                >> When the Japanese imported it, they used the characters much more phonetically.

                Japanese kanji are much less phonetic than Chinese hanzi. For hanzi, you can ask "how is this character read?", and it's a simple question with a simple answer, because that question is the basis of the writing system. Kanji are assigned all kinds of different readings on the theory that what really counts is the semantics.

                For example...

                >> They used the whole word when that worked

                Not even in the oldest Chinese writings do you see one character representing a multisyllabic word. Identifying characters with words rather than syllables is an innovation on the part of the Japanese.

                Tangentially, you mentioned that the vast majority of characters are phono-semantic compounds. I've been watching some youtube videos in which Japanese people are presented with kanji of varying levels of obscurity and asked to speculate on their pronunciation. Without fail, when they don't know the answer, the interviewees speculate that the two major components of the character both contribute to its meaning.

                And that always surprises me because a two-meaningful-components construction is so rare in the character system. Almost all characters aren't constructed from two meaningful elements, and I would have thought the Japanese would be familiar with that fact even though they can't understand the phonetic hints. Do you think this is more of a case of them not knowing how characters are formed ("ignorance"), or more of a case of them speculating on the meaning of each component purely because they don't have the ability to speculate about the phonetics ("searching under the lamppost")?

                [Particularly where the obscure kanji are part of an obscure phrase borrowed from Chinese, speculating about the phonetics would be helpful to the problem, but I'm assuming most Japanese just plain don't know what kinds of sounds a Chinese phonetic component might be hinting at.]

                • By kragen 2025-09-0723:031 reply

                  I think mostly you're talking about kunyomi. Some do have multiple onyomi (大 being the most obvious example) but it's not common, and it's not a case of "all kinds of different readings on the theory that what really counts is the semantics".

                  I agree with your "searching under the lamppost" theory. If I'm Japanese and I see an obscure kanji, its phonetic (component) only gives me information about its onyomi, which is almost certainly some wildly obscure loanword from late medieval Chinese that isn't even in my recognition vocabulary, much less my productive vocabulary.

                  It might also be true that I don't know offhand the onyomi of other characters with the same phonetic—in real life I'm a native English speaker, a second-language speaker of two or three Romance languages, and the kind of person who likes to go around thinking about obscure etymological trivia, but I was today days old when it first occurred to me that "suspicious" was probably etymologically "overseeish", cognate with "perspicuous", "spectrum", "speculum", etc. (I was right about "spicious" but wrong about "sus": it's actually "uplookish".)

                  So it would be totally unsurprising for even a highly literate native Japanese speaker to know the onyomi of numerous characters sharing the same phonetic, but not have that shared sound come to mind when looking at a novel character with the same phonetic, even if they can guess which part is the phonetic and that the obscure word is in fact Chinese in origin. And the YouTube video is likely edited to focus on the people who got things most entertainingly wrong.

                  • By thaumasiotes 2025-09-080:571 reply

                    Yes, I'm talking about kunyomi; I don't see how that affects the point.

                    > If I'm Japanese and I see an obscure kanji, its phonetic (component) only gives me information about its onyomi, which is almost certainly some wildly obscure loanword from late medieval Chinese that isn't even in my recognition vocabulary

                    I was highly amused when one of the "obscure" kanji presented was 論. It doesn't get much less obscure than that.

                    On the other hand, none of the interviewees recognized it. All of them got 檸檬. (Another one I wouldn't have expected to be obscure, but in that case I would have been right.)

                    It's possible that there's some selection for interviewees who provide entertaining responses, but the effect seems weak to me for two reasons:

                    (1) Of the people featured in a video, you see all of them respond to every prompt. So selection has to be limited to "which people are going to appear", and even then if an entertaining person is boring on some prompts you'll still see that.

                    (2) Getting things wrong almost always consists of making one or two wrong guesses and saying "I don't know". It's much more entertaining when people get them right, unless they turn out to be obvious and everyone gets them right.

                    > (I was right about "spicious" but wrong about "sus": it's actually "uplookish".)

                    You'd need super, not sub, for "up" or "over". Traditionally it's "over"; I'm not sure if there's another Latin prefix that gets used for "up". There is one for "down", de (as in "depend", "descend", or even "defenestrate"), but nothing comes to mind for "up". The opposite of "descend" is "ascend", where the prefix just means "toward".

                    • By kragen 2025-09-081:171 reply

                      Presumably when prewett said "When the Japanese imported it, they used the characters much more phonetically," they meant onyomi. (Perhaps they didn't know about kunyomi.) When they say, "but the characters got assigned to the Japanese pronunciation of the word," that is mostly wrong as a description of how Japanese writing uses kanji today, but I think that is the process from which kana came: https://en.m.wikipedia.org/wiki/Man%27y%C5%8Dgana and apparently it isn't quite extinct: https://en.m.wikipedia.org/wiki/Ateji

                      There are kanji less obscure than 論. There are some that are so common that even I know them. It is in the 6th grade jōyō kanji, but I doubt it's in the top 1000 most common characters in Japanese, maybe not even the top 2000. You could probably guess that 侖 is the phonetic, and 論 is a Chinese loanword so that might help, but by itself that's an even less common character, so you probably won't know it if you don't know 論. 侖 occurs as a phonetic in 倫 and 輪, but that's no help, because there it's "rin" instead of "ron". Did anyone guess "rin"?

                      "Sus" actually is "sub"! As in "look up to". From below, I guess, like the South Wind. Just as an overseer or supervisor sees from above rather than seeing something above him.

                      • By thaumasiotes 2025-09-083:381 reply

                        The word for lemon, 檸檬, that I mentioned above is a recent ateji. The characters come from some southern Chinese language borrowing the word "lemon" from English. The Mandarin pronunciation follows the characters, resulting in ningmeng, something just different enough that English speakers are unlikely to notice the connection.

                        The Japanese word for the fruit is also borrowed from English, resulting in the much closer レモン remon. But the spelling is borrowed from Chinese (when kanji are used at all), despite the pronunciation coming from elsewhere.

                        > There are kanji less obscure than 論. There are some that are so common that even I know them. It is in the 6th grade jōyō kanji, but I doubt it's in the top 1000 most common characters in Japanese, maybe not even the top 2000. You could probably guess that 侖 is the phonetic

                        It's not an especially common character in Chinese either, though it is part of some common words like 讨论. (论 is the simplified form of 論.) But frequency of occurrence isn't the only way you can fail to be obscure. I call this one of the least obscure characters in existence because it is the name of the most prominent Confucian work, the one conventionally titled Analects in English, 論語 "discussions".

                        Consider that "spangled" is not a word in common use in the USA, but Americans can be expected to recognize it anyway.

                        > Did anyone guess "rin"?

                        I don't remember.

                        > Presumably when prewett said "When the Japanese imported it, they used the characters much more phonetically," they meant onyomi. (Perhaps they didn't know about kunyomi.) When they say, "but the characters got assigned to the Japanese pronunciation of the word," that is mostly wrong as a description of how Japanese writing uses kanji today

                        I read prewett very differently than you do. To me, when he says "the characters got assigned to the Japanese pronunciation of the word", he is referring to kunyomi. I don't think that's wrong as a description of how Japanese writing uses kanji today. But I do think it's wrong to describe that use as "much more phonetic" than the Chinese writing system. I see it as much less phonetic.

                        • By kragen 2025-09-0811:00

                          I didn't know about 檸檬! Is that Meiji-era?

                          Hmm, I was probably working too hard to interpret prewett's comment as something sensible.

    • By sameermanek 2025-09-0616:47

      It was invented by store managers to counter the karens of that time. /s

      Oops, im not on reddit, sorry

  • By tzury 2025-09-0619:043 reply

    Quote:

        I wonder how people store dates older than this. 
        
        Maybe if I’m a British Museum manager, and I want to keep theft inventory details. 
        
        How do I do it? As an epoch? Store it as text?
    
    The answer: Text.

    Many items in museums have no specific date but Circa X. I have spent a lot of time in the early 2000s to enable "Sort by date" in museum registrars software I was maintaining despite having it textual

    • By ghurtado 2025-09-0619:106 reply

      > Sort by date" in museum registrars software

      This sounds like the perfect invitation for some old school over engineering.

      I'm already having so much fun running through every possible input in my head, and I would inevitably write a serious mountain of steaming code to support it.

      • By tzury 2025-09-0620:08

        I simply built a side table in the DB, whereas any expression was associated with a range of a 2 YEARS (numbers).

        any time they enter and expression (auto complete), it they introduce a new one, they needed to add the range.

        this did the job.

        the time I spent the most was to sort the existing data and restore it in the new dictionary.

      • By kehvyn 2025-09-0710:31

        I've actually done this, and it's very fun.

        My main testing dataset is the 470,000 records from the Met, with 33k unique date values. Fortunately they include machine-readable dates I can validate against.

        https://github.com/kjrocker/epochal

      • By jacquesm 2025-09-0619:51

        That's got to be a study in exceptions. Let's start with which calendar we're referencing. C14 anybody?

      • By Waraqa 2025-09-0619:382 reply

        I assume an integer field is sufficient since mostly it's only the year that they know not the exact date.

        • By brazzy 2025-09-0620:162 reply

          No, you need a lot more complexity if you really wanted to represent it semantically. The assumption that people in the past used calendars with sequentially numbered years you just need to offset, is simply wrong.

          You have things like "in the Xth year of the reign of King Y", where we can easily relate multiple entries with different values for X, but don't actually know which CE years they correspond to. Even weirder is the Roman habit of recording "the year of the consulship of X and Y", which doesn't even allow you to relate any two different years at all without a reference table (which we don't have completely). And no, "years from the foundong of the city" wasn't a thing.

          • By kehvyn 2025-09-0711:37

            I actually looked at supporting dates like this, but if you go through the Met's open dataset (https://github.com/metmuseum/openaccess) that kind of "alternative calendar with no reference to the BCE/CE dates" is basically nonexistent.

            There are references to the Islamic and Japanese calendar systems, but always next to the CE equivalent.

            Data entry is fortunately being done by modern people, so the translation to CE/BCE is usually baked in, and all you need to support is every possible way somebody could say "the early half of" and "5th millenium B.C. to mid 1914"

          • By kragen 2025-09-0710:33

            Mostly true, but not absolutely:

            https://en.wikipedia.org/wiki/Varronian_chronology

            > The Varronian chronology was adopted by the Roman state during the first century BC and gave rise to the traditional years ab urbe condita ("from the founding of the city"); most especially, those dates were used in monumental Augustan-era inscriptions, the fasti Capitolini and the fasti Triumphales.[40]

        • By Atlas667 2025-09-0620:40

          Text is better together with specific formats like Circa, ranges, exact years or dates, and unknown.

      • By lazide 2025-09-0619:41

        Turing complete DSL, here we come!

      • By rossant 2025-09-0619:51

        Tiny language model.

    • By scrollaway 2025-09-073:42

      I think the world could use an “imprecise” data type, which would be a tuple (t, margin).

      In your case: if you wanted a date plus minus 50yrs, that would be (date(d), range(years, 50)).

      Some construction like this allows for I believe most use cases. You just need to be able to store: date, date time, date range, and the precise/imprecise versions of all of these.

    • By divbzero 2025-09-0621:532 reply

      > The answer: Text.

      That was my immediate thought too and led to me wondering: How do you represent BCE dates in ISO 8601?

      Apparently ISO 8601 always supports YYYY from 0000 (1 BCE) to 9999 (9999 CE). ISO 8601 can also extend beyond those limits if agreed upon by sender and receiver: e.g. -0001 (2 BCE), -0002 (3 BCE), etc.

      • By ralferoo 2025-09-077:06

        Hopefully nobody uses this "standard" that bakes in an off-by-one error into the human readable form.

        IMHO if code is doing extra parsing to handle -ve years, they should have enough logic to know to how to skip the zeroth year when converting to and from the human readable form.

      • By wvbdmp 2025-09-078:49

        Okay… someone please steelman this seemingly unhinged decision.

        edit: Apparently that’s how they do dates in astronomy since it makes the math easier. Can’t even count on years being gregorian these days…

  • By jcims 2025-09-0621:501 reply

    I'm 52 years old and it has been this way since I can remember but for some reason I can't make it not bug me. Any time we have the biggest/oldest/smallest/fastest/etc example of something, it's described without any qualification of seen, known, observed, etc.

    For example, this isn't oldest recorded transaction, it's the oldest widely known record of a transaction (probably).

    Why does that still bother me? Obviously nobody is saying it's the oldest recorded transaction, right? That would make it the first recorded transaction, and nobody is calling it that.

    And here I am likely triggering your own pet peeve of useless comments on HN. xD

    • By namenotrequired 2025-09-0710:171 reply

      It can be the oldest without being the first, if the earlier ones no longer exists

      • By IAmBroom 2025-09-0813:18

        No, then it would be the "oldest surviving". Which is a qualifier, which is what the poster above you asked for.

HackerNews