PostgreSQL in 100 Seconds
Вставка
- Опубліковано 26 лип 2023
- Try Postgres with Neon bit.ly/neon-fireship right now. Postgres is one of the most popular open-source SQL databases. It is an object-relational database that supports a wide range of datatypes and design patterns. Learn the basics in this fast intro tutorial.
#programming #database #100SecondsOfCode
💬 Chat with Me on Discord
/ discord
🔗 Resources
Postgres Docs www.postgresql.org/docs/
Futuristic Databases • 15 futuristic database...
SQL in 100 Seconds • SQL Explained in 100 S...
🔥 Get More Content - Upgrade to PRO
Upgrade at fireship.io/pro
Use code YT25 for 25% off PRO access
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- What is Postgres?
- Postgres quickstart tutorial
- Postgres vs MySQL
- Postgres vs SQLite
- Postgres vs Oracle
- What makes postgres different?
- What is an object-relational database? - Наука та технологія
Neon has been my goto Postgres host recently. Get a free database here bit.ly/neon-fireship
cap
are you telling fireship that his favorite postgresql host, inst his favorite postgresql host??
Don't need autoscaling for my 5 individually started projects, that have each five tables with 10 entries each, and never will be touched again x)
I've kinda been procrastinating from learning postgres, you guys got any good resource recommendations?
dont lie
Before now, I would absolutely swear that there's already a 100 seconds of Postgres by fireship. Guess this is due to the level of expectations I have for jeff.
same
I was also a bit confused, but I think it's because he has covered it before in his databases rundown videos where he compares different databases or goes through them one by one. I'm glad he's making seperate videos for them though.
I also have expectations for a Django in 100 seconds video
I wish it happens 😁
@@theworldismine7788 I second this!
#MandelaEffect
I genuinely had no idea you could define types (objects) in Postgres. Always learning something in these
Yeah I thought it was just sql for mac
@@dingdongmus LOL
OO = Bad.
Same! That was a total 🤯 moment for me.
@@muhdiversity7409 Your comment = Worse.
I'm surprised he still has content to make after so many videos.
yea
He will never run out of content because front end frameworks exist.
The world of computer science is a mysterious place.
@@varadrane7 true, like every week there's 3 new js or ts frameworks
He still hasn’t done clojure
Clarification: Michael Stonebraker created Postgres in 1985 as the successor to Ingres (which was a proprietary commercial DB). However, it did not use SQL as its query language. It used a variation of the QUEL query language called POSTQUEL. This may have stymied its adoption somewhat. It did not have a SQL interpreter until the mid-1990s after which it was renamed PostgreSQL in 1996 to emphasize that it did support SQL.
Thanks for the info
The "Postgres + SQL" version was actually called "Postgres95" and released in 1994, according to the "Brief History of PostgreSQL" page in the official docs. It was renamed to "PostgreSQL" in 1996 for obvious reasons. When I started using Postgres in 1997 or 1998, the doc was severely lagging, and still called it "Postgres95".
Michael Stonebreaker then went on to create the databases Aurora (commercialized through StreamBase), C-Store (commercialized through Vertica) and H-Store (commercialized as VoltDB), and SciDB.
Explains why old folk call it Postgres.
Thanks for Googling this for us 👍
It's great that all the Fireship videos about a software I'm using only get published when I need them
for how long have you been using this software?
lmao got the video suggestion while I was writing a query in the pgadmin
Your visual of an actual table with architectural columns on top crossed by oars (for "rows") is one of the most helpful things. Spreadsheets finally make sense. Thank you for that!
Talking about spreadsheets, I believe google doc allows you to use sql to get data from spreadsheets if you define specific table locations
That blew my mind. I had no idea it had all these amazing features !
Blows every other SQL database out of the water. And PostGIS is a whole thing in itself
This is not true, it really depends by the use case.
For mf that only store data in databases yeah, for actual ppl with knowledge on databases, then no.
@@anthonysteinervcould you elaborate? Why is it not good as other sql databases?
@@hmmm....1910 Speed, for one. Which is critical.
People that see videos like this and are blind to real use cases all look like "But MongoDB is webscale" guy to me.
@@aguy278 Speed is not speed. You need to eleborate, write speed, read speed, query speeds... That is one of the many strenghts of postgres to be easy customisable. You need sharding, easy peasy use something like timescale. Need fast lookup for geodata, postgis it is.
The more videos I watch, the more I realize how little university actually teaches us. PostgreSQL seems so awesome, why did we only write stuff like "SELECT * FROM TABLE"?
That's SQL, which is still used by postgres. The examples in this video are using an ORM that creates those queries under the hood.
They only teach Microsoft sql server, why so blind uni?
@@jazzymichael that is not true at all. he is using psql syntax to query a postgres database directly. no ORM is being used.
@@nahuelpiguillem2949 The idea is to teach you the general theory. Postgres is great, but plenty of places don't use it. Better to teach SQL that at least somewhat resembles what you'll use everywhere, than focus too much on a single implementation just to come out to the real world where it's completely irrelevant a lot of the time. MSSQL may not be feature-rich in comparison to Postgres, but its syntax is close enough to other popular choices that learning it doesn't force you into a bubble
Why learn what variables and constants are when you can write react?
You literally made this video exactly when I needed it. Thank you so much!😀
As for custom types, Postgres also allows to easily define own custom operators ("User-Defined Operators" in documentation).
operator overloading is the devil
@@harrywang4769 Operator overloading is lovely... But not in the database
Not sure why I would want to use custom structured data types in a DBMS. That breaks normalization.
@@lawrencedoliveiro9104 This is the best for simple structured types when it makes no sense to give them an id. Think about complex numbers, colors, maybe money (value + currency), time (value + timezone), jsonb etc. I don't have experience with PostGIS but it probably also has custom types for shapes like polygons. Then, it makes sense to define custom operators for them, and then custom indexing.
This semester I'm going to learn about this.
Thanks you Fireship for the good intro about Postgre SQL😁
Thank you. I appreciate the content and the time you spent on making it.
Tbh the most powerful database. I use it for high traffic applications and mongo/fauna for initial development. PS - Hasura is like magic for postgre.
true
I like it because it feels like a cool hybrid being able to do MySQL stuff like when I worked in WordPress, but also document-like transactions because of its JSON and JSONB abilities.
and its open source
The most powerful database is Oracle, if you can afford it. PostgreSQL is the most feature rich ORDBMS, and it has also a lot of NoSQL support, so to speak. You can use MongoDB for high traffic applications as well, I don't see why you transition from one to another, since they are very different.
I used Postgresql before but I had no idea we can create custom types and use inheritance! 😮
I just love this channel. He always manages to pack a short video with usable visual information and it always gets me excited about the technology. And it never lacks humor.
Suggestions for the 100 seconds of code series:
- Payload CMS ( A free and open-source, highly customizable code-first Content Management System )
- -Zig-
- Vite
- Vercel
- Turborepo
- FastAPI
- Django
- Edge Computing
Zig was covered fast!
Also vite
Thank you. I am working on a personal project and this will help quite a bit.
Another quality minutes of content. Thank you Fireship!
Your timing is impeccable! I was looking for a database host for my Strapi project!
What is a strap project?
About damn time, just started a project with it and this notification was a heaven send cuz it's my first time with the 🐘
I was just learning about it yesterday lol, you read my mind
same
0:00 I love the epic intros to these videos. the visuals and that music
Fascinating always wondered about postgres thanks
How come he always makes the content just when I need it the most.
Cool to have one of these about a topic I actually know something about for once
Wow I didn't know that postgres was object oriented, still learning this is crazy!
Damn, I've been using postgres for ages and I learnt a ton of new stuff, lfg
Thanks, added to my Resume!
This 100s videos are just gold.
I love watching this for fun now; when I really need to understand PostgreSQL, I will know exactly where to return.
I am glad you made this video
Whenever you think you need a new special purpose database, first check if postgres already does it
Funnily enough, this also applies to Postgres’s own problems: Need to scale out or a better way to handle failovers? YugabyteDB literally lifts most of the storage-agnostic part of PSQL and staples it on top of an ACID distributed K/V store. It’s so compatible that frameworks like Django literally can’t tell they’re not talking to normal PostgreSQL (things literally only break when you try to use certain extensions like PostGIS because they don’t have GiST indexing yet).
ooh, I was looking at it like Oracle DB-lite, now I can take your transcript and make yet another TODO list, thank you!
It's crazy he still has content for his videos
Great video, actually learned something new about Pg 🎉
Just when it's needed! 🔥🔥🔥
WE NEED a video about Googles Web Integrity API, which will most likely block Adblockers in any chromium based browser, it got merged into the chromium repo yesterday
After all these years, You finally made a video on Postgres.
postgres is awesome & i love stored procedures / functions.
This is literally the first video I searched for when I was learning PostgreSQL and Prisma and I was so surprised it didn't exist before.
What is prisma?
@@candylook50 It's an ORM that helps model your postgres database. He actually has a video on prisma in 100 seconds.
It is a great video , informative and enterteined , citus interesting and other extensions worth the time to look at them I guess
I hope this 100 seconds videos not to stop
I've used postgres quite a lot, but I had no idea that object syntax was possible or inheritance on tables.
I guess I mostly stuck to the sql standard features, interesting to see those
Bro, PostgreSQL has had support for user-defined composite types, which are essentially lightweight object types, since version 7.1 which was released in 2001. However, more full-featured and robust object-relational capabilities were introduced in version 8.0.
Oracle, instead, introduced some initial object-oriented capabilities like support for inheritance and REFs (object references) in 1992, and later on with version 8 in 1997.
You really need to catch up with the world.
@@biomorphicrelational DBs == the world
They are not _good_ features.
Same. And what's interesting is orm like hibernate don't utilize this features, it generates basic tables for entities, then uses standard sql select's and joins, feels weird...
You can also create columns with the datatype JSON and then use JSON functions to query those columns.
great NEON ad. Enjoyed it! :D
Neon is really good, great sponsorship for the video!
We use PostGres for a project at work. There's some mapping involved, so PostGIS proved really useful for that. Also, the JSON data type is great. If there are parts of your application that change really quickly, it can be much faster to put complex data in a JSON column rather than change the table schema every few weeks. Just make sure all of your data doesn't end up in there.
What does PostGIS do?
@@candylook50 It adds some GIS related functions to the database, like the ability to measure distances according to particular map projections, or check if a coordinate point is within some defined region.
Awesome explanation!
Postgres is so cool that makes databases exciting to learn
Plus put the sponsorship disclosure at the front of you next amazing video! Thanks!
Just started using Supabase. This vid came at the best time.
It's almost like you knew I was looking to learn a new DB technology
Perfect! I was just thinking of learning postgres :)
same
tbf you learn more about postgres working with postgres than trying to learn postgres
also, basically all your sql works
@@F38U thx for the suggestion buddy
same bro
Well explained in 100s 👏🏻
I built an entire ERP from scratch for my business, and now the database is already 2 GB and has 30 tables. The database is in MySQL because I couldn’t for the life of me understand PostgreSQL and I found your MySQL video very easy to understand. I always wished I did it all in PostgreSQL because I can see the limitations of MySQL.
Now, when my ERP has thousands of lines of code and hundreds of columns, you post a PostgreSQL video… I’m not sure if I want to watch and risk remaking my entire database and backend.
Loved this video 😍 As I use PSQL
Bro can read my mind, uploads postgres in 100 secs just when I am interested in
Ok, don’t use hstore or JSON types. hstore was the original key value type in v9.2 and was quickly replaced by JSON. JSON was then replaced by JSONB (a binary version which basically enables full document features). For me some of the amazing things about Postgres is the ability to use it to run queries that return full JSON which you can pipe out of an API. The JSON functions are super powerful and with CTE you can make amazing and insanely fast things.
Hasura abuses the hell out of that JSON output feature, and while it’s awesome it does put more strain on a component that doesn’t scale horizontally. I guess there’s nothing stopping you from just using Yugabyte instead and saying “f**k it”
@@romannasuti25 yeah careful putting your app functionality into the DB. Like everything it depends on the scenario
Is histore called as H when shortened? I’ce heard it at work but I don’t get what it does.
Hade a case of the mandela effect thinking I already watched a PostgreSQL video from this channel. Was surprised to see this was recently posted.
Jeff you took me out on Tables, Columns and Rows 😂😂.
Like how did you take those literally 😂
Awesome as usual
This guy is a mind reader, I was just googling about Postgres the other day 😂
damn I was just using it as any other regular SQL database but it has so many more features, I'll have to take a closer look at it
I needed this
Thanks for this video on PostgreSQL. Please make a video on Scala programming language.
Thank you for this 😊
Though i thought in past about "why DataBase handling is in limitted structure,syntax & why not/how to implement great features from programming languages" (and real life inspirations) + simple is often quite useful,though complex needs tools & talent,mind to look for that 😅 +
Though Database is needed for simple storage,though in business case,it may increase,but just like pipelines or simply "Transporatation",
All we have to do is "carry the object,message,document,etc,,." or so and programming languages are for working natively (mostly,even network means native work in cloud,passed via internet or some client sync)
We should work around "available" tools,to squeeze it into work 😅
Still gotta know why/what/how to GraphQL & need to learn/create own,integrations,clean support to easily switch over,translate to one another tool (kinda good passion ideas 😊)
Thank you for this again (though history to fill up time,well academics are this way 😅 getting college,sister kani to many memories)
Wish all be well 😃🌟✨🙌
22.12.2023 09:01/2 pm ist
(679th comment,25k+ likes,4,82,625+1 views)
You overdid it with the sponsoring in this video
Developing with Rails and PostgreSQL feels pretty smooth
that sponsoring is seamless and not boring 👏
I didn't know most of that, even though I've used Postgres before, cool
I'm currently using postgres in an express.js project, it works so fast, i'm so happy with it. I'll probably use it with any kind of programming, except mobile, php or python.
What is express.JS?
@@candylook50 it's a javascript http framework
Wow. As someone still learning, ive only used mysql for the most part, and am rather excited to use these postgres features now.
What’s the main difference between the two? Trying to follow.
can't wait to see Fireship in 100 seconds
BRILIANT EXPLANATION EVER
The only man who can reasonably put **everything** on his resume
I don't even know that postgres is an object oriented database. Thanks fireship
2 questions: How does Neon DB compare to Cockroach DB which are both serverless postgres databases? Second, would you suggest we use ORM with Neon or Cockroach or only SQL?
Cockroachdb is not a postgres database. It uses the postgres parser & wire protocol so that it can reuse existing ORMs & drivers written for postgres, and it supports a subset of what postgres can do, but it doesn't have triggers for example
Neon is literally running postgres and only replaces the storage layer that the postgres code calls into
@@BosonCollider Ah thanks for clearing that up.
Its sometimes difficult to read between the lines with all the marketing spiel from these companies.
CockroachDB is not a PostgreSQL database. Both are hosted cloud databases though. I don't know how they differ, but maybe one could offer something else such as globally distributed in different continents and geo-replication.
Make a video on Inngest events / queues. Looks sick!
Thank you!!! I never knew postgres had awesome features like these... Can you do a comparison between postgres and ms sql server?
I've used PG as a data analyst in multiple companies for more than a decade and have never seen these features... Mind blown
This means nothing to me, but I really enjoy watching the videos!
I've used Postgres for a number of years but I never knew it's actually an Object-Relational Database
Same
Same xD
Literally the first line of the first page of the documentation 😂
@@nodidog who reads that? :P
PostGIS is awesome, love postgres!
surprised a video on pg was made only now
The beauty is that you can use postgresql for your basic RDBMS needs, but the more you know about it, the cooler it becomes.
What is RDBMS?
U got the golden content
My favorite place to store data outside of VSAM.
"Like a programmer can have mupltiple Lambos, let's find them!"
0 results found
Key word being "can", not "will". ;)
1st Viewer str8 from Nakuru, Kenya. Our E-citizen platform is hacked. Now we are learning ICT by force.
So it means that as it can scale as well, while storing json data as well. It can be used for both nosql and mysql?
What is nosql?
Definitely need a beyond 100s for postgres
a video on jetbrains kind of like your vscode one would be cool
So this whole thing is just an ad for Neon
Sad but true.
Great video.
How come bro uploads video about just the technology I am recently interested in! :)
It's crazy how much I didn't know about this even though I use it every day. Probably because I resort to ORMs so much
Thank you for speaking about the elephant in the room. Seriously though, it's one of my favourite database servers :)
Looks like new javascript frameworks are taking time to come into the market 😅 so your channel is on the side-quest videos.
That left join returning 0 results means there was no data available in programmers table. hence no results found.
Note: The LEFT JOIN keyword returns all records from the left table (programmers), even if there are no matches in the right table (lambo).
Yes, he made a mistake - it should've been an INNER JOIN instead.
So where are all the programmers, then? I'd tell someone about this, because it seems like a bigger problem than finding no programmers with Lambos!
woa i was just learning this