How and Where to Take a (PostgreSQL) Dump, or, When Documentation Lacks Detail

How and Where to Take a (PostgreSQL) Dump, or, When Documentation Lacks Detail

I’ve made crazy progress in the last couple of weeks. As a result of that, I’ve managed to get my grubby hands onto SQL and I’ve even wrestled with which database management system to use. I used Digital Oceans’ succinct article to settle on PostgreSQL.

Unfortunately, unlike the SQLite I’m a bit more familiar with, PostgreSQL databases (DB) don’t come in one handy portable file. I spent maybe a couple of hours poking around the PostgreSQL directory wondering where the DB was. Then I googled it and read some articles a bit more closely and figured out it’s more complicated than a single manifestation in a single locus.

So, using the vocabulary I had, I googled “how to export PostgreSQL database” and a couple of other variants related to it. Didn’t work. But at some point, I found out that you have to do a dump. That gets you a file you can move around. But not many were good at explaining it, or even the concept of it. Finally, I read the documentation here and thought, this should be easy. But once I’d done a pg_dump, I couldn’t find the file. I spent another couple of hours trying out various things.

Then, finally, finally, I YouTubed “postgresql dump” or something like that and found this silent video. I watched it carefully and realised that the dump is created in the directory from which I work in the command line. And that has not been mentioned in all the previous places I’d looked in, including the documentation. Maybe it’s obvious to experts. But beginners need something a bit more explicit.

The Aggravating Prong of Epistemology

The Aggravating Prong of Epistemology

You’ve heard of forks. What about prongs? Prongs are like forks, but with more, uh, prongs on them. Did that make you think Gnu? That totally made you think Gnu, didn’t it?

Anyway, there are two types of prongs. I don’t really want to name them like that because now it sounds so official. And I’m making this up on the fly but, well, there you go. Now it’ll be in your exams at the end of the semester. Stop groaning. If you’d done something simpler, like brain surgery or rocket science, you won’t be in this mess, would you? Serves you right.

So, there are two types of prongs, broadly speaking. In the first scenario, a prong happens when you want to learn something new, but unfortunately, that new thing is part of some ecology of knowledge. To understand it, you have to understand this other thing, and that other thing, and that other thing over there and there’s also that one by the window, and another one under the stairs, and there’s its brother-in-law and his dog in the kitchen will be the ones to bludgeon your brain with another right thick epistemological tree branch that you also need to understand to understand that one thing.

This will happen to you a lot as you move from the pure and liberating empty-headedness of not even having made the decision to learn to code to becoming a mess of a person at 3am in the morning deep in a morass of open tabs on every subject under the sun that could be remotely related to the English alphabet as you try your desperate and futile best to understand that one thing.

That’s the first scenario, for which I used to have examples but did not write them down. Oh well. They’ll surely pop up again.

The second scenario is similar. It happens when you want to find out What to Do Next. At this point, you’re a feckin’ noob with a soft skull and half a brain when it comes to programming. You may have been a stupendously magnificent diplomat and you stopped World War III by charming the pants and undies off the husband of a diplomat’s wife with your high-brow intellectual wit and sharp observance of his idiosyncratic cultural mores, but in this world of code, you are shit.

So what happens? You go to Google. But alas, you’re in Poland right now and the internet connection is– seriously, why is it so bad? This is Europe, isn’t it? I thought it’s supposed to be way better than this. What do you mean Eastern Europe is different?

All right, all right. We’re digressing way too much. Let’s move on. Google Chrome takes up too much resources so you open up Microsoft Edge and go with the default Bing to save time. Sigh.

The question of the day for me (I’m switching to me now. It’s not all about you.) was thus: I have made a sketch of a small app I think I can deal with. Now, what do I have to do to turn it into a Tinder or Instagram-like thing with users and such? Where do users go? Into a dictionary? I don’t know. I’m a noob.

So Bing gives you this:

How Can I Build an App Like Tinder

I read it and quickly isolate two things I need to learn next to make my app come alive: a backend, and RESTful API’s. Hang on to these two. They’re crucial to the plot. Like when Snyder’s Comedian died in Gotham and breathed, “Martha…”. That kind of important.

Before we move on, let me just say, none of the definitions of “API” I’ve seen have described it to me in sufficient clarity so that I understand it. I kind of gave up trying to figure out what it is. Maybe I’ll get a sort of instinctive embodied sense of it as I go along. Hopefully.

So, I think, right, I need a “back end”. What on earth is a “back end”? I toyed with Flask once. It worked kind of like WordPress, but it also looked like a Prestashop CMS. Is that a “back end”. I don’t know. I’m a noob. So I Bing “back end” and hit Wikipedia:

Front End and Back End on Wikipedia.

Too many words, so I return to Bing. Along with a tab for Firebase, a “back end” open from the Quora piece,  I open up the following:

Flask, a… framework? What’s a framework?

Flask on Wikipedia

I don’t get it. But, I have to move on. So I Bing something like “python back end for android app” because I’m most familiar with Python. Although I’m familiar with it in the same way Jem and Scout are familiar with Boo Radley. Wha-? What do you mean who? Do you guys not read books? Geez. Boo Radley!

Anyway, Binging that gives me these:

Creating a Web App From Scratch Using Python Flask and MySQL

Can I use some Python in the backend for an Android app?

Which is better for my back end needs: PHP or Python?

I want to develop a backend for an Android app. Which technology should I use?

Adding a database/backend to android applications [closed]

In one of these many links, “Node.js” is mentioned, and I’m currently learning JavaScript. Maybe that’s framework? I’ve always thought it’s a framework. But Node.js on Wikipedia says:

Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of tools and applications. Although Node.js is not a JavaScript framework…

What the hell is a runtime environment?! Wikipedia:

A runtime system, also called run-time system, primarily implements portions of an execution model. This is in contrast to the runtime lifecycle phase of a program, during which the runtime system is in operation. Most languages have some form of runtime system, which…

What the– What?!

Ok. All right. Take a deep breath. Don’t lose it. You’re doing fine. Just breathe. I’ve heard of ReactJS. Is that a framework or a runtime environment or a back end? Wikipedia:

React (sometimes styled React.js or ReactJS) is an open-source JavaScript library providing a view for data rendered as HTML.

It’s a LIBRARY?

*Defenestrates computer in frustration.*

I’ve also heard of AngularJS and I’d Bing it but I’d just thrown my computer out the window and someone’s probably dead four storeys down because that’s what happens when you hit people on the head with the weight of all that knowledge.

FUCK.

So, I go all the way back to the original Quora entry on how to build a Tinder-like app. Yes. That’s all I have. After twenty minutes of aggravating pronging, I learn nothing more than the fact that I still need to find out what back end to use and how to work with RESTful API’s. Notice, I am tired out enough not to bother looking for their definitions anymore. And that is what a prong does to you.