Welcome to another edition of HeyDT. HeyDT is a series of videos I do where I respond to viewer questions and comments. These viewer questions and comments they typically come from comments posted on the videos on YouTube and Odyssey. Sometimes these viewer questions and comments come through social media such as MasterDyn, Reddit, sometimes through email. And the very first question I want to read is, HeyDT, I can't explain to Windows users the dangers of proprietary software and closed source operating systems and the freedom of using Linux and open source software. Can you please make a video explaining what potential dangers are there in closed source software? Alright, so think about all the evil, malicious things that a piece of software can and actually does do to people on a daily basis. Typically the most dangerous stuff is privacy related stuff. So data mining you, you know, stealing all of your information, spying on what you're doing, what you're reading on the internet, what you're searching for on the internet, what files you opened up on your computer, the contents of those files on your computer. Also crypto miners, you know, these days that's a very common piece of malware where people are putting Bitcoin miners unbeknownst to you on your machine.   And many people, millions of people around the world have this kind of stuff working on their computer. These pieces of nefarious and malicious programs that are on these people's computers and they don't even know it. And the reason they don't know it is because they can't inspect the code. Closed source, proprietary software, you can't audit the code. It's not possible. It's not legal either. The license many times will, the license prevents you from, you know, decompiling the code and trying to take it apart and inspect it even if you could. And that's one of the benefits of using free and open source software. Now that's not to say that somebody couldn't put a piece of malicious code in a piece of free and open source software. The point is though, that if they did that, you could find out about it because the code is available. You can audit the code. You can inspect the code and you can see exactly what that software is doing to you, where with proprietary software, you have no way of knowing. With proprietary software, you are putting 100% of your faith in the proprietor of that proprietary software.  You're trusting them because you have no way of knowing exactly what they're doing. And for people like me, I can't trust these billion dollar, trillion dollar corporations like Google, Microsoft, Facebook, Apple, because we all know better. We know these companies are built around making money. Of course, all companies want to make money, but these guys, how do they make money? Well, these days, typically, they make money by using you. They don't sell you software. You're actually the software, right? They give you programs like Windows and Office and things like that, but it's not for you to use that software. They give you that software so that software can use you so they can data mine you, get all of your information, and then either use that information to sell you other products or to sell your information to other companies that will then try to sell you products. Now, if you don't want to get into the tricky parts of trying to explain what free software is versus proprietary software, especially to new Linux users, people that have been using Windows their whole life, trying to explain to them the free software movement and the open source movement, that can be a little overwhelming to them. I would just explain it to them in real world terms. Tell them, hey, I've been using Linux for however many years you've been using Linux and tell them I've never had a virus. I've never had any kind of spyware, malware, ransomware installed on my computer. I've never opened my web browser on a Linux machine and had 18 different toolbars on my browser. I don't know how any of them got installed. Tell them that doesn't happen on Linux and then it'll click in their mind. They'll be like, oh, really? I just thought that was part of using a computer, right? Because that's all they've ever experienced. All they've ever experienced is being used by Microsoft Windows. And the next question is, hey, DT, what tool do you use to empty your trash on your main production machine? So what he's talking about here is you guys that are familiar with Windows and Mac know on the desktop, you've got the little trash can icon or recycle bin, whatever it is that they call it these days on those operating systems, where when you delete a file or a directory, it doesn't get instantly removed from your machine. It goes into the trash bin first.  It's a safety measure. We have this on Linux too. So in our graphical file managers, so in GNOME, you have Nautilus, the file manager on KDE. You have Dolphin. You also have other file managers, Kaja, Thunar, PCMan, FMM. All the graphical file managers on Linux have a trash can, similar to the one found on Windows. Now what I'm assuming he's asking here as far as managing trash is command line. So in Linux, many of us use the command line for all of our file management. And that's what I do. I don't actually open a graphical file manager very often. Typically, when I want to do simple file management stuff, I just open a terminal and do it inside the terminal. But the problem is when you delete files inside the terminal with the rm command, the remove command, so I rm a file. It's instantly deleted. It doesn't go to a trash can. Now there are command line trash cans that you can install. One of the most popular is a program called Trash CLI. I've never used it, but there's several of these trash command line programs that you can install if you're worried about accidentally removing things at the command line. The way I handle this, though, is I actually make my remove command an interactive command. So rm, mv, and cp, all three of those commands have a dash i flag for interactive, where when you run those commands on a file, it will ask you if it's going to override a file or delete a file. It will ask you yes or no. And that's what I do. I alias my rm command to actually be rm space dash i. So when I remove a file, it always asks me yes or no. I always have to answer that question. So I have two chances. So I never really accidentally remove a file doing it that way. So I don't actually need a trash can manager. But those of you that do, yeah, look into trash CLI or one of the other trash can managers for your command line. And moving on to the next question. Hey, DT assalamu alaikum, wa alaikum assalam, you did not tell what the difference between vlc and mpv. So would you please explain this? So this was from my Garuda cutal video. I mentioned something about vlc and mpv and I actually installed both on my machines because I like both. But what's the difference? Well, the main difference is mpv is much more minimal as far as design mpv is strictly a frame around a window. You don't really get any menu systems or any kind of graphical settings. mpv is extremely powerful, much more powerful than vlc. But the problem is most of those settings involve you manually adding config files or doing things at the command line. Because again, you don't have all the GUI settings and menus and things inside mpv the way you do a program like vlc vlc. Now you do everything through the GUI and vlc is it's really intuitive and very easy to use. That's probably why many, especially beginner user friendly Linux distributions, desktop Linux distributions, they almost always install a program like vlc for a video player rather than mpv. Again, because mpv is so minimal, people that are new to mpv would probably find it a little off-putting. Now the reason I usually install both mpv and vlc on my machines is a lot of it has to do with the fact that I've been using Linux for so long years ago, you know, 15 years ago, you know, about the time I was starting to explore desktop Linux, you know, many Linux distributions back then didn't install multimedia codecs needed to play a lot of your audio and video multimedia formats, right. And one of the ways around that typically back then was to just install vlc because vlc as a multimedia player depends on all those multimedia codecs and it would pull all that stuff down for you so you could play all your dvds and blu-rays and things like that.  Nowadays, though, that's not really needed, you can install any video player because these days, many of our desktop Linux distributions are no longer as concerned with legal issues as far as multimedia codecs. Most of them just ship them all by default anyway. Another reason why I also like to have vlc installed is playing audio. vlc has a really nice feature right there in one of the menus where you can actually on a multi-track recording.  So, you know, if you had a right speaker, left speaker, I only send sound through the one speaker, you know, on the one track. And that's a really nice feature of vlc that's just there out of the box. MPV, I'm sure could do the same thing, but again, I would have to jump through some hoops to do something like that on MPV. Moving on to the next question. Haiti, yes, Windows is spyware. But nowadays, almost all of us have to use spyware or have spyware on the hardware level, such as Intel, ME, AMD, PSP, and that's said. And he's right, that is said. So, this is more of a comment rather than a question. So, what he's saying is, you know, I complain about proprietary operating systems and proprietary software being spyware, things like Windows, Windows 10, absolutely is closed source proprietary spyware. Windows is spying on you, their data mining, you Windows kind of admits that.  And he's saying, I guess my complaints about Windows are really not justified because we have things like Intel, ME, the Intel management engine on Intel processors and AMD, PSP, which is platform security processor on AMD processors. We really can't get away from some of these companies on the hardware level spying on us. So, why am I complaining about Windows, I guess? Well, just because other companies are also spying on us, doesn't make Windows spying on you any less egregious or evil, or we should just stop complaining. Like, well, everybody spies on you, so you should just accept it. No, no, we never accept this. This is not something that we should ever get used to or just accept as normal. And when I say we shouldn't accept Microsoft spying on us, I also think we shouldn't accept companies like Intel or AMD. We should really, once we get the solution as far as open source software solved, you know, and I think we're winning that battle. I think people are starting to realize free and open source software is better than closed source proprietary software. We're winning that battle. The next battle we really need to start fighting, of course, is the battle for open hardware. And the next question comes from one of my videos. It was either one of my shorts videos or something where I had a time limit I was trying to meet and I was talking really fast. He says, hey, DT, are you on meth? No, actually, when I do those shorts videos or even these hey DT videos where I talk kind of fast, so it's not an hour long video. What I'm actually on is a Joe's brand coffee. I have a coffee cup here and I'm heavily caffeinated right now. Joe's brand coffee is one of the best brands of coffee available. Of course, you get that in the little curing cups or you can get it in loose coffee grounds as well. The next question I want to read is one I get all the time and it's typically hey DT, can you try some piece of software once I've recently got or hey DT, can you try the sidekick browser or the my pal browser, et cetera, some other browser because I'm always trying out new browsers. And the problem why I haven't tried out a lot of these browsers, people suggest, is they're either licensed under a proprietary license or in the case of the my pal browser, I couldn't actually find a license for the thing. I go to the GitHub, there's not even a license mentioned on the GitHub. If it is either licensed under a proprietary license or it doesn't have a license at all, I'm assuming that qualifies as proprietary. So I'm not going to review anything unless it specifically says it's free and open source. I just won't do it. Sidekick is not free and open source software. My pal, it didn't have a license when I checked on it a couple of weeks ago. I checked on it again yesterday because I knew I was going to make today's video and I was going to respond to this question about my pal. And now the GitHub has been completely deleted and the guy that was maintaining it says he was kicked out of the project. So I don't, I don't even know what's going on with that. But again, these products, I've never heard of them before these people asked me about them and then just checking on them. They don't seem like they're stable projects and they don't seem like they're free and open source either. I am never going to cover proprietary software on this channel, at least proprietary software where there's clearly free and open source alternatives, such as Brave and Chromium and Firefox and the millions of free and open source browsers that we have available on Windows Mac and Linux. The next question is another one I get all the time and it's typically something like this. Hey DT, do you have a telegram chat group or hey DT, do you have a discord? Hey DT, do you have some other proprietary service that you hang out on? No. Again, I try to stick with free and open source software where possible free services where possible as well. So telegram is not free and open source software. I've never had an account. I don't plan on ever having an account. I just, it's not something I'm interested in. I don't chat anyway. So I don't like being on those kinds of services anyway. I'm definitely not going to sign up to a proprietary one. Same thing with discord. I do have a matrix chat room.  Linux nerds that talk Linux and free and open source software and many other topics, Vim, Emacs, Tiling, Window Managers. If you guys want to go hang out in my matrix room, feel free to hang out there and talk with others about Linux and free and open source software. Matrix is free and open source software for those of you wanting a great desktop matrix client element is probably the most popular matrix client. And the final question is, Hey, DT, it looks like you're using the awesome window manager. I haven't figured out how to configure my monitors and have it save because I have to do it every time I reboot. Do you have any recommendations? So what he's talking about here is something that we all have to deal with those of us that use standalone window managers, tiling window managers. He mentions awesome window manager, but this could be any standalone window manager. If you have multi monitors, typically, you know, however, those monitors get plugged into your graphics card, you know, the monitors could be out of order when you log in. And depending on the ports on your graphics card, you may not be able to get them in the correct order just by plugging them into the graphics card. So instead of having monitor one, two, three in the correct order, you have monitors one, three, two, where you moving the curse around the first monitor and then it's over on the third, the second monitor over here really in the third position, then it's in the middle monitor. And obviously, you have to correct that. And how do you correct that is typically you can do it through a command line program, X Render X R and R. But that's kind of complicated for people that don't know how to use that program. Typically, what I recommend you guys use is a R and R, which is a graphical front end to X R and R. So use a render. It's in everybody's repose. Many Linux distributions actually ship it by default, some of the more minimal ones, especially the ones that use tiling window managers. Now how a render works is it's a graphical program, you launch it, and it gives you a visual representation of all your monitors. So if I got three monitors, it'll have three boxes. And it'll tell me exactly what the names of those monitors are, such as DP one, DisplayPort one, DP two, HDMI one, whatever, you know, however many monitors you have, and however they're connected to your graphics card. And then all you do is you click on it with your mouse, the monitors, and you rearrange them in the correct order, graphically right there inside the GUI. It's dead simple. Hit apply, and magically your monitors are saved in the correct configuration. Now when you reboot, they will not be in that same configuration. You'd have to do that again. But a render has this great thing. It saves a config file for you. So when you click save, it will save, I believe it saves it to a dot screen layout is the name of the file. I don't know, but when you save it, it'll tell you the name of the file. And it's basically a shell script that executes the X render command to rearrange your monitors in the correct order every time. So when you save that file, and you find the location of that shell script, make sure in your auto star hook for the awesome window manager or whatever window manager you're using, that shell script gets executed every time you log in, and your monitors will always be in the correct order. Now before I go, I need to thank a few special people. I need to thank the producers of this show. I need to thank Gabe, James, Mitchell, Paul, Scott, Wes, Akami, Alan, Chuck, Commander, Angry, Yuki, David, Dylan, Gregory, Heiko, Lee, Maxim, Mike, Nitrix, Erion, Alexander, Peace, Arch, and Fedor, Polytech, Raver, Red Prophet, Steven and Willie. These guys, they're my highest tiered patrons over on Patreon without these guys. This episode of HeyDT would not have been possible. The show is also brought to you by each and every one of these ladies and gentlemen as well. All these names you're seeing on the screen, these are all my supporters over on Patreon because I don't have any corporate sponsors. It's just me and you guys, the community, if you like my work and want to help me out, please go check out DistroTube over on Patreon. I'd love your support. All right guys, peace.


What's this guys? It's Marvel collectors core. I'm doing another unboxing for you guys Looks like you guys really enjoy that and I want to start doing more of them Let me just say I'm a big Deadpool fan So the second I saw the next Marvel collectors core is Deadpool.  So let's get started Let's be honest. It's a little bit easier to open than any other box that I've done before But I want to let you guys see what's inside of it. Just a little beauty of a view now For frankly, so once they've distributed what the hint of this thing was the pop. That's what I knew I had to buy it. I knew it was Deadpool I was kind of if you're never getting one of these collectors cores But the second I saw the pop I wanted to get it But first let's go through what else is in here first So we have this little taco stand thing It's a little taco chocolate. Let's get a little bit close as Deadpool on it and you put your tacos in there That's pretty cool. I guess then We have this cool little thing for luggage for a backpack, which is cool. It's a cute little Whatever and we have little bath time Deadpool. Now this goes on your key chain. I need a new key chain I like bedtime Deadpool and it's cute. But like I said The main thing that we bought this box for The holy grail of all things. It's kind of like when I open the box like let me show you It's kind of like a legend of Zelda one. It's like Let's look at this thing. So let's look at this thing up close.  I love how the background. I don't know if you guys can see it, but in the background There's actually a rainbow back there now That is freaking cool. I really like this pop overall I think it's a cool ass pop I feel that box over there and it just goes with Deadpool in general. I think it's such a cute little pop It's Deadpool riding a unicorn. I'm probably gonna take this one out. So I'll show you guys what it looks like All right, so here's what the pop looks like overall So you got a little Deadpool riding the unicorn and it just it looks cute I like it. I like little Deadpool-ish things and yeah, so that is the Marvel's collector's core Deadpool unboxing Now I'm kind of getting used to these unboxings. They don't like totally bash me, but it's fun to do them It's fun to get my like first reaction. I'm a little disappointed that I knew what this one was But I am excited for next. I think September is when it launches and it's Venom I didn't plan on doing the subscription again, but now that's Venom. I'm gonna have to because it's freaking Venom I love Venom. He's one of my favorite characters as well So looks like you guys will be getting an unboxing of that as well And of course guys, thank you so much for watching this if you guys are new here Tell me down below. Did you guys get one of these Funko boxes? We're looking forward to it. Now. Do you want to get it? I do have to look for that Funko pop Let me know down below in the comments you guys are seriously all the best I appreciate and love all the support you guys give me and of course hit that subscribe button if you guys are new here And you guys enjoy this stuff I do unboxings movie reviews anything pop related talk and video games any sort of geeky nerd culture thing You can find on this channel Of course guys hit up see how much on films down below cuz right down there you guys and get into advanced movie Streams check out some movie news and also some movie reviews till next time. Yes, I'll stay classy


Another sign that summer is here is the annual Bemidji JC's water carnival buttons have now gone on sale. The buttons are available at multiple occasions around Bemidji, such as Marketplace Foods, Subway, Orton's, Kenny's Clark, DeSauro and the Bemidji woolen mills. Now if you are considering taking part in the medallion hunt, the medallion button is a must have if you want to win the big grand prize. So if you plan on taking part in the medallion hunt, it's a really good idea to purchase the gold star button because then you can claim the $500 grand prize instead of just the $250 prize. That button is only available for a short amount of time and both buttons will get you into the entertainment tent. Now clues for the 73rd annual water carnival medallion hunt will be announced beginning Monday June 26th and will continue until the medallion is found prior to July 4th.


everybody forced here ripping 2022 absolute baseball hobby five box number 21 random team style i will leave the results on screen for just a moment and you can always find them at latensportscards.com thanks everybody for joining and good luck cubs red wilson contrarus to 99 triple jersey auto yankees cooper bowman to 199 astros rookie dual jersey auto chasmic cormac to 199 and reds ricky jersey tony son t on the 299 yeah maybe we'll see one day i don't know i don't know what'll happen with those guys and the angels alex pregnant by storm blue to 149 yankees babe ruth to 99 got mariners ricky jersey card calrally to 199 redemption rays wander franco tools of the trade three swatch signatures spectrum red grats rays great hit nice that'll be a multi relic rookie auto big wander hit all right icons red kirby puckett twins to 99 frank thomas white socks to 199 dual jersey yankees jayson domingas number to 199 dodgers rookie baseball material booklet signatures andre jackson number to 99 silver and black on the auto nice jackson there carlton kibrian haze twins rod caru to 25 red triple jersey auto jose burrero to 199 rookie quad relic auto erin ash beat of 50 oh you don't want to go that's a nice center patch there thomas sapaki rookie triple jersey nets to one that to 149 that's the way god unless you live a good distance away then and i can see that mariners ken girthy junior number to 199 rangers rookie ink zack rex to 199 rookie quad patch auto erin ashby seven of 10 10 great looking card second ashby for the brewers this one's beautiful gold to 10 and jumbo patch brett phillips to 99 rays not a raised patch player worn though i received before there is looks like a tiger's patch oriel's extreme team cedric mollins to 149 yankees john carlo stanton to 199 royals jersey card george brett to 25 game worn brett and another hit for the rays here shane boz rookie material a booklet signatures to 99 nice boz yeah that reds rays game is a shootout though it's 10 to 5 right now in the top of the nine rookie class read detmer's to 149 miami jash chisum to 199 oh boz started for him i can tell i can tell you got lit up royals john heasley rookie jersey to 299 met jeff mcneill jersey card to 299 and cleveland elie morgan rookie material booklet signatures number to 99 a lot of silver and black the uh ball relic autos yankees bay bruce red to 99 yankees steven writings rookie auto to 199 angels brandon marsh tools of the trade rookie jersey auto number to 199 nice marsh and patch card diamond backs christian walker to 99 orials are a giant's patch all right last one all right that is a rookie class edward tabrara marlins to 149 joey vato reds to 199 cardinals one yippe is rookie jersey to 299 carlo muller braves rookie dual jersey auto book braves on the muller oh they swept them oh geez yeah i'm not sure if the reds are gonna or the rays are gonna hold on to a playoff spot like they've got great pitching but their offense is pretty stagnant at times shane boz rookie to 999 rays philly steve carlton to 199 dual relic auto mariners andres muneos it's a 75 nice relics there muneos doesn't hydrate i think those are both hydrate patches the navy and white my mariners i don't think it is though louis freos dual relic rookie auto debacks to 50 reds had four walkoffs how do you do that in one week dual jersey debacks karson kelly to 99 that's a lot of walkoffs for like a month all right recap here we start with our relics karson kelly juan yippez christian walker jeff mcneill john heasley george brett uh brett phillips thomas chapucky jason dominguez cal raleigh tony son tion louis freos andres muneos steven writings brandon marsh erin ashby zack rex erin ashby jose barrero chaz mccormick cooper bowman all the books now we had kyle muller braves these are all relic auto books elie morgan cleveland rays shane boz and um dodgers andre jackson with a wander franco redemption tools of the trade three swatch signatures spectrum red big congrats to the rays that'll be sick we've got platinum anniversary coming up next thanks everybody


Why don't we like to feel? To express our emotions, I believe it's vulnerability. We believe that we have to uphold a certain image. That image starts by being upheld to other people and slowly later to ourselves. We want to believe that we are untouchable, that we never have bad days, and that nothing bad can ever happen to us. Almost that we aren't human. I don't like to feel because I don't want anybody to think less of me when I do. I don't want anyone thinking that I am weak. But even more so, I am afraid of what other people will do with my emotions, with my trust. Will they use it against me, and have that lesser thought about me? Oftentimes we are told don't cry. To it I answer, feel everything. Feel everything all the time. And the emotions that you hate or may not understand. Each of us have a duty to take care of ourselves. Allow yourself to cry, allow yourself to be angry, to yell.   Your emotions are your intelligence, and your motivation. Why do you deny yourself your own nature? I said that we have a duty to take care of ourselves and to feel. But most of all, allowing yourself to express and especially feel love is one of those duties. The most important one.


guys, welcome back to another one. If you are new to the channel, I'm Gold Pony. I do new car truck SUV reviews on YouTube. And today we are in the new 2021 Maserati Levante courtesy of Faulkner Maserati in McKennaxburg PA for more information on their inventory. Please feel free to check out the link in the description box below. So I'm in this one today because for one, I have yet to review a Levante. I've literally reviewed every other Maserati but this one. So quite excited to be in it for that particular reason alone but there are also some major tech upgrades for the specific 2021 model year of the Levante. This is available with a twin-turbo Ferrari-derived V8 as well, we'll get more into the power plants in a little bit here. So in this video, I will be testing out and going over everything about this one from acceleration to braking, steering for ride quality, sound system exhaust clip, all of that fun stuff. So having said all of that, what do you guys say? Let's just go ahead and jump right into it and as always, let's start with pricing. And so as you can imagine, there are several different trim levels for the Levante. First one being the base setup starting at $78,290. Then for that setup, there is a Grand Lusso and Grand Sport. Both of those started at $84,290. Then there is the S trim level for $89,290. And again, two package options, Grand Lusso and Grand Sport going for $94,290. Then there is the GTS. That one goes for $125,890. And lastly, the Trofio. That one goes for $153,090. But as you can imagine with that many trim levels, there are two different engine configurations available for the Levante. First one belonging to that base trim and S trim level. That is going to be a three liter twin turbo V6 putting out 345 horsepower, 369 pound feet of torque for that base trim level. However, if you jump up to the S that bumps it up to 424 horsepower, 428 pound feet of torque sent to all four wheels either way, through an eight speed automatic with paddle shifters available. Zero to 60 time comes in at 5.8 seconds for the base, five seconds flat for the S trim level. And then top speed, 156 miles per hour for the base, 164 for the S trim. MPG numbers coming in at 16 in the city, 22 on the highway. Either way, taking premium unlit fuel. But so then there is the other engine configuration belonging to the GTS and Trophy-O trim levels. And that one is going to be a 3.8 liter twin turbo charged Ferrari-derived V8, 550 horsepower, 538 pound feet of torque for the GTS. Trophy-O jumps that up to 580 horsepower. Again, 538 pound feet of torque sent to all four wheels through an eight speed automatic with paddle shifter zero to 60 time for both of those trims. Four seconds for the GTS, 3.8 for the Trophy-O. Top speed, 181 miles per hour for the GTS, 187 then for the Trophy-O that is quite fast for an SUV. MPG numbers coming in at 13 in the city, 20 on the highway, taking premium unlit fuel. But so then before we do any kind of fun acceleration test here in our particular Levante, I do want to mention to you guys, there are some driving modes. There's drive mode buttons are located just to the left of the shifter. People include normal, off-road and sport. And so having said that, what do you guys say? Let's go ahead and put it in sport driving mode. It did immediately just downshift for me. So it is going to hold the RPMs at a much higher level, giving you more power on demand. That's always a good thing. And ultimately drive modes will just shift points throughout a response and steering sensitivity. So now having got all of that out of the way, what do you guys say? Let's go ahead and find a straightaway. Let's put this thing to the test. And by the way, we do have that base engine configuration today. In case anybody was curious, but let's go ahead and see how quickly we can get our new 2021 Maserati Levante here up to speed. Oh, it seems like a good spot as any. It's fun. All right, I gotta be honest, that was a very fun acceleration. Absolutely no issues emerging onto the highway whatsoever. This thing is a beast. And this is the base engine configuration, you guys. This isn't even the Ferrari-derived twin turbo V8. This thing is still plenty quick for any kind of daily driving without a doubt. But anyways, to go along with that acceleration as always, braking is equally important. So upfront, you will find 13.6 inch ventilated front disks in the back, 13 inch solid rear disks. Do want to mention though, that is for the base engine configuration that we have today. If you jump up to the S trim level, that actually jumps up the brake size as well, bumping that up to 15 inch ventilated front disk. 60 to zero stopping distance comes in at 127 feet for the base trim that we have today. And then 118 feet for the S trim level. So let's go ahead and just, yeah, definitely no issues there. I think I might have enjoyed the S trim level a little bit more. I would imagine it would bring you to a much quicker stop, but it's not a soft braking feel. It's definitely on the firmer side. So I do appreciate that without a doubt. But then touching on suspension and handling upfront, you're gonna get a double wishbone style front suspension with air springs in the back, independent multi-link rear suspension. Once again, with air springs, gas pressurized shock absorbers, front and rear stabilizer bars as well. And to go along with that, a limited slip differential, which essentially, of course, sends torque to the wheel with the most traction, not only giving you a better acceleration, but also better handling then as well. And my very favorite, a four corner auto leveling suspension. And so this is your air suspension. And by the way, there is actually a button just behind the shifter here to adjust that air suspension manually if you wanted to go ahead and do that. This essentially is going to give you the very best ride quality possible. Whenever you put an air suspension on any vehicle, you are going to get absolutely amazing ride quality, of course. And I will say, the ride quality is definitely quite nice here in our Levante without a doubt. So absolutely no issues there, but it's pretty much to be expected. As far as steering feel goes, it is a very noticeable difference dependant on which driving mode that you put it in. I've left it in sport for the majority of my drive here, and it is a much heavier steering feel. It instantly points you in the direction that you wanna go. That is the steering feel I prefer, but even in the normal driving mode now that I just now put it back to, it's perfectly fine. So no issues there with the steering feel whatsoever. As far as cabin noise goes, there isn't a whole lot of exterior wind noise coming into the cabin. And that is to be expected with the acoustic laminated glass that we have here in the Levante. So that is definitely quite nice. And touching on visibility, I don't know because of its shape, it's not the very best compared to some of its competitors, but I will say it is definitely something you will get used to without a doubt. So really for me, it wouldn't bother me whatsoever. So visibility is plenty fine. And also rain sensing windshield wipers actually do come standard on the Levante as well. Essentially what that is is whenever this one detects any kind of missed rainfall, it's gonna automatically turn on this windshield wiper. So it's kind of like automatic headlights, just one last thing you gotta worry about there. But that about rounds out the performance segment of this review you guys. So let's go ahead and take a look at the exterior of our brand new 2021 Maserati Levante. All right, here she is, you guys. The new 2021 Maserati Levante finished in Bianco Alpi, I believe the color name was, but let's go ahead and start up front on this one. Of course, front grill, you have that traditional Maserati vertical slats along with that massive Maserati logo front and center. Definitely looks good to the sides by Xenon HID headlights. And they do come with the automatic feature of course, meaning when it starts to get jocked at night, those headlights are going to turn on automatically for you there. LED daytime running lights also coming standard. And I did want to also mention to you guys, every single other trim level, but the base trim level is going to give you adaptive LED headlights, meaning when you're going around a bend at night, those headlights are going to swivel based on the direction of your steering angle, better help illuminating what is around the bends. That is always a big plus as well. And of course, just below those headlights, you guys can probably see it. You do have fog lights as well. And probably my favorite part about this is so many SUVs these days are going with that matte black front lip and side skirts for that matter, but the Maserati Levante does not do either of them. They do make it body colored, which is so much more of a high end look, so much better of a look in my personal opinion. So I definitely appreciate that. But now let's go ahead and make our way to the side of the Levante. All right, so now since we are around to the side of this one, there is a couple of different setups you can go with when it comes to the side profile. For example, the windows surrounds can be found in chrome or gloss black depending upon which configuration you go with. Rear privacy glass does come standard across the board and you gotta love those Maserati fender accents on the front fender, of course, with chrome surrounds, they definitely look quite good up there. Body colored side skirts, as I just mentioned to you guys as well, when it comes to the wheel configurations, 19 inch aluminum alloys coming with the base, Grand Lusso trims and the S trim level. However, 20 inch aluminum alloys coming with the Grand Sport trim levels and the GTS and then the Trophio is going to give you 22 inch alloys in case anybody was curious. But the other thing I wanted to mention is towards the back on the C pillar, you guys could probably see, you got the Maserati logo back there as well, just like the Quattroporte. So definitely a very good looking placement for that logo as well. But now let's go ahead and make our way to the back of this one. All right, so starting up top, you do have that body colored shark fin antennae just below that rear spoiler with an integrated brake light just below that rear window wiper. And of course you guys could probably tell LED tail lights do come standard on this one, a very nice design to them as well. In case anybody was curious about what that Q4 badging is that essentially signifies that it does have all wheel drive and Maserati terms I guess you could say. Just below it all you can find a body colored rear bumper and love that as well. And again, a lot of SUVs are making that matte black so I love that the Levante did not do that and just to the sides of course, dual exhaust outlets with quad chrome tips. And I did want to mention at this point the exhaust note is going to differ depending upon the drive mode that you put it in. I actually found that out. If you put it in a sport driving mode it is a much nastier growl. It sounds amazing. So having said that, I do believe you guys know what we have to do next. As always here is that exhaust clip. All right, so now since we are around back of the Levante here when it comes to opening that rear tailgate there are a couple different ways to go ahead and do that. There is of course a button on the key fob itself. That is one way. There is also of course a button on the tailgate itself. So either way of course is perfectly fine. Once opened up cargo capacity comes in at 20.5 cubic feet. If that was not enough space, there is a 60-40 split bumping that up to 57.4 cubic feet. In that cargo area though you will find tie down anchors back there.  There's cargo area ventilation as well. You do not always get that in SUV. So I wanted to mention that. And if you look underneath the cargo floor you will find some in-floor storage actually as well.  So it is kind of a Velcro kind of setup to actually go ahead and hold that cargo floor up. But I don't think I've ever seen an SUV that was clever enough to do such a simple thing like that. So well thought out Maserati. I think that is very useful. But anyways then making our way up to the rear legroom that is going to come in at 37.2 inches. So for reference I mean even six feet tall. This is how much space I had in the second row there behind my own driving position of course. Reclining rear seats also do come standard. There is a rear center armrest with cup holders as well. Rear ventilation also standard. And it is a cool little setup for the charging ports back there because there are dual rear USB charging ports and a 12 volt power outlet as well. But you can actually choose to close that up if you did not want it exposed or you can leave it open if you did want it exposed. So just taking the extra step. So I like that I wanted to mention it. And since we're back here I also wanted to mention another very cool feature of the Levante here. You have frameless doors. That is a frameless door glass I should say. Which is so cool. It's kind of a coupe like silhouette then with the frameless door glass. So I thought that looked pretty cool and also soft closed doors. I don't think I've mentioned that yet either.  So Mercedes Benz does that, BMW does that. So I thought that was pretty cool as well. But now let's go ahead and make our way up to the front seats. 12 way power adjustable front seats do come standard heated front seats. Also standard of course. And they do come with two way memory positions as well for two different drivers. So I thought that was pretty cool. If you want a ventilated front seats go with either the Grand Lusso or the Grand Sport or any of the upper trim levels of course. And these seats by the way were extremely comfortable and perhaps the most comfortable part of the seats just like in the Alfa Romeo Stelvio I recently reviewed were the headrests.  It is so amazing. These softest headrests that I've ever tested through my 550 ish vehicles that I've done so far are between the Stelvio and the Levante so far. They are absolutely amazing. I love them. But anyways, now let's go ahead and make our way up to the steering wheel. It is tilt and telescoping. It is leather wrapped. It will actually be heated for every single trim level as well. I guess it's expected at this price range but you don't always get that. So I was pretty surprised I liked that. Then when it comes to the startup let me first start by showing you guys the key here. You do have your Maserati logo on the one side and when you flip it over lock, unlock that button to pop the rear hatch and that times two button is going to be a remote start. So when super cold days you can actually warm up the Levante before you actually get inside. So that's definitely a nice little convenient feature there as well but it is all keyless entry with a push button start. So all I'm going to do is simply put my foot on the brake and press that engine start button which is actually located just by the driver's left knee with just about every other vehicle out there. It is not located there so I wanted to emphasize that but once started up when it comes to the gauges they will do a full sweep speedometer is going to be on your left tachometer is on your right and there is a small digital display front and center which can be controlled by using the steering wheel mounted controls and really that gives you everything you could possibly want up there like outside temperature, trip A, trip B when you need your next oil change, digital speedometer the list goes on. So pretty much everything you can need up there. So then making our way to overall interior quality a dual pane panoramic sunroof actually does come standard on Levante love that. My favorite part though is going to be the suede headliner. You guys have known if you watched my reviews in the past I love suede headliners it gives it such an upscale feel to the cabin, to the interior of any vehicle and I love that it comes standard here on the Levante. Maserati analog clock front and center leather wrapped and stitched shifter didn't mention that previously someone didn't mention that lecture mechanical parking brake does come standard there is actually a button just behind it all to raise and lower the suspension manually as well which I've always found is pretty cool in other vehicles as well. So let me go ahead and stop this video here for a second. I'm going to show you a quick time lapse of the adjustability of that suspension configuration because I thought it was pretty cool. So here you go. Anyways, continuing on with the interior quality here contrast stitching found everywhere. We have some orange contrast stitching found in the doors. It continues just above the passenger side glove box as well then wood trim accents are going to be found with the Grand Lusso configuration of this one. Then in front of the shifter you're going to have a little bit of storage there USB charging port, auxiliary port and an SD card slot then as well behind the shift you have dual cup holders and then within the center armrest there is a ton of storage within that including dual cup holders actually within the center armrest as well. I didn't expect to find that there but they are 12 volt power outlet also coming standard then within that center armrest too but now let's go ahead and make our way to the tech display. Continue on with the interior here new and improved. This is really where the change came in the big change for 2021 here. New and improved 8.4 inch color touchscreen display Bluetooth and audio streaming coming standard Android Auto Apple CarPlay factory navigation system also coming standard you can of course check out your climate control settings up there as well and your radio information. And by the way when it comes to the sound systems on the Lavante eight speakers do come standard. That's the one we have today but there is a 14 speaker harming card and sound system that will come standard with the Grand Lusso and Grand Sport. So we again we do have the eight speaker sound system. So what do you guys say? Let's go ahead and turn on the radio see what we got playing today and let's test out the clarity of this one. It's all right. It's not too bad. I mean it's not the best sound system I've ever heard but it will certainly get the job done for the Lavante plenty of base for this thing. It's a big last thing I wanted to mention to you guys on that infotainment screen at least is when you do put the Lavante in reverse you will find an extremely high definition rear view camera letting you know who or what is behind you which is always is going to lead us into safety. And so to start front side, side curtain airbags do come standard. In the back you're gonna have latch AKA lower anchors and tethers for children for the rear car seats. Rear child door locks, tire pressure monitoring system also coming standard though front and rear parking sensors. You usually don't get that standard. So I thought that was pretty cool. Also a blind spot monitoring system as well but there is a driver assistance package that is optional that goes for $1,700. That really gives you the good stuff. That's gonna be adaptive cruise control forward collision warning with autonomous emergency braking, a 360 degree monitor, traffic sign recognition, active driving assist and pedestrian recognition then as well. And so all in all when it comes to my final thoughts here of the Lavante the finishes and the materials used in this SUV are perfection. I will say that it does not get much better than you got in the Lavante here with the suede headliner with the leather and wood finishes in the contrast stitching. Definitely very nice interior quality. Acceleration is really great as well even in the base Lavante. I will say that you're not gonna have any issues merging onto the highway in this one. Styling is wonderful as well. Exhaust note is brutal. I love it. Do not expect that on the base Lavante here but once you switch it into that more aggressive driving mode it definitely gets so much deeper. I love it. But anyways, the tech is very high definition as well. Probably one of the more high definition infotainment screens I've seen in quite a while. And again, that was the improvement. So that makes sense. But definitely like that. As far as room for improvement goes on this one full digital gauge cluster is pretty much a necessity in this day and age. I would say especially on a luxury vehicle like this BMW does that, Mercedes-Benz does that. Hyundai does a Mitsubishi does it. I could go on and on but just about everybody's doing that now the reason they do it is because it does give the driver full customization. You can change the different gauge loadouts to make it look however you want to make it look. So I don't know, I would have loved to have seen that. And also safety should never come optional especially at this price point. I did what I said that with that driver assistance package I do believe that should probably come standard on the Lavante. But that's just my personal opinion. Hey, so that is about it for this one you guys. Thank you so much for watching. Feel free to follow me on social media at the bottom of the screen there if you wanted to see what's coming next to the channel before it actually gets to YouTube be sure to hit the subscribe and the bell notification button if you're into new car reviews. That is what we do here on this channel after all. Do appreciate you guys watching more than you know when I will see you guys all in the next video. Stay cool.


Hi, I'm going to talk about a practical post-crust protocol primer. I plan to pack as many pieces as possible into the primary part of this presentation, but I require way too much practice and preparation, so I'm going to stop. So my name is Will Linewerber. If you have any questions about this or miss any of the links to the talk, my Twitter handles Linewerber. I work at a company called Citus Data. It's a very little bit about that because they sent me over here. It's an open-source extension to post-crust that takes care of horizontally sharding so you can use many, many machines to run queries in parallel and go beyond the means of a single post-crust. This talk has not much at all to do about Citus except that since Citus is just post-crust, you could use the protocol with it, I suppose, and they talk to each other over the post-crust protocol. Also, being a post-crust conference, this is something that I only learned after I ran a five- to six-hour data migration in a transaction, and then I typoed one of the table names and then it blew away the entire transaction, and had I known about this, it would have saved me because what this does, if you set this in your P-SQL RC, it makes a save point every single time, and so if you have any typos, you don't lose the whole transaction. When you set it to interactive mode rather than just on or off, it only kicks in if you're using P-SQL manually. If you're piping in a script, it doesn't change that. But so this, I've been putting this in the front of my post-crust slide talks because more people should know about it, it's hard to find. So set on a rollback interactive. Also, this is straight from my P-SQL RC file except I use a little bit more colorful language in the comment that I didn't include here. Okay, so the motivation of this talk. So I got to know the post-crust protocol through writing a driver. Originally, I linked against the LIPIC queue, but then for a couple reasons, I needed to implement the protocol myself, mainly to get all async I.O. And I got a really, by doing that, I got a better understanding of post-crust, and I want to share some of that with you. You kind of get insight into why things are the way they are for certain things and why some things are possible and why other things are a little bit harder to do. And also, the protocol can do a lot, but you might not need all of it. And so if you go to the documentation, it's going to tell you everything that is possible, but you may not need all of that. And so in this talk, I'm going to show some of the actual code that I used and that way hopefully is a supplemental guide to the documentation to give a different perspective. And so what we're going to do is we're going to connect to post-crust and authenticate, and then we're going to send it a query, read the response, and then eventually disconnect. And so I hope by doing it in the order that you would use it, it sort of hopefully tells a little bit of a story as much as talking about the post-crust protocol can be a story. All of the code here, if you want to look at it, is from CrystalPG, my GitHub name is Will. The protocol part of it is only about 770 lines of code. And so if any of this interests you, hopefully that's an approachable amount of code that you can, with the sort of touch points that I show, you can hopefully find them and then start piecing together like sort of the missing parts. And it's not so much that hopefully it's not too intimidating, less than 1,000 lines, like I think it's pretty comprehensible. And then also this is all going to be about version three of the protocol, which was introduced, what is it, 2003-14? Yeah, 14 years ago. Post-crust 7.4 is also the one that added auto vacuum. I was looking through the release notes of other notable things. And so it's been on the same post-crust version for quite a long time. You can see here some of the new things that protocol three added. And since then, it's just been protocol three for that entire time. All right, let's get to it. So the first phase is the startup phase. A little bit of terminology. The client, your program is called the front end. And when you connect, what happens is Postmaster gets that connection. It forks off a new back end at the operating system and then passes the connection to that back end. And then that's only when authentication authorization is done and so on. And when you disconnect, post-crust drops that process. This is also why, as I'm sure many of you know, you're not supposed to kill dash nine a post-crust back end because they have shared memory to communicate between these different back ends when they need to and with the Postmaster. And if there's any unclean shutdown, it has to assume that all that shared memory is corrupted and we have to kill all of the back ends and restart them and we have to start from scratch. And that's why also if you look, there's going to be all these different back ends. All right, so how do we actually get the startup packet together? We're going to have a number of key value pairs. We're going to have the user that you're, the role or the user that you're trying to connect with, the database name.  For example, application name, the client encoding, you know, any sort of the so-called GUX GUC, which is the internal name for all of the pset and set commands, you can list as many of these as you want and these all come along with the startup packet. And then the first thing you need to calculate is the total length because the protocol is going to want to know the size of the message that it's about to receive. And so how do we actually send it? We're going to send the length, which includes itself, so that in 32 of its own length, it's that plus eight. And the one is for the null at the end. And then we're going to send the version number, which is three, but you see that that is actually a number much larger than three. What they're doing is the high order bits are going to be three and the low order bits is the dot zero. And so if there ever was like a three dot one, which there hasn't been, you would put that in the, it'd be like, you know, three, zero, zero, zero, one and so on. And then we send all of the arguments, the key value pairs separated with a null byte because it's a C string, one last null, and then we send it. And then we're off to the races. We've told Parchus we want to connect. And then, but what we haven't done is any sort of security. And so servers may or may not actually support open SSL. They might not be compiled with it. And so what you have to do before you do that startup packet, you have to ask somehow, do you support SSL? And the way you do that is you send, you pretend to be the protocol version, 80 million, 877,103. And so that number's a little bit funny, but what it is, if you split it apart into hex and then look at it, it's one, two, three, four, five, six, seven, nine, the eight's gone. When I was putting this, when I built this, I didn't know why the eight was missing, but in putting this talk together, I figured out why. And you'll find later. And so what you do here is you send the startup backup like normal, except you just send this protocol version and then, you know, make sure you send it. And then what you're gonna get from the server is either a character S saying that it supports SSL or an N saying that the answer's no. It can also send an error response. I haven't actually seen that, so I don't have any examples of what the errors could be. For my purposes, if anything goes wrong, I just say, hey, everything's all wrong, let's bail out. And now it's your responsibility as a client what to do with that information. You can, if they said yes and you want to do SSL, you can go ahead and negotiate, you know, do the SSL handshake and so on. If it supports it, and for some reason you don't want to use it, you can just continue on as normal, or if it doesn't support it and you know, you're saying I require SSL, then you can abort the connection. But all of those sort of things you've seen in Postgres, the SSL mode, prefer, verify CA, require and so on, that's all instructions to the client and the server doesn't get any of that information. You're doing that all on your end of how to proceed once you know whether or not the server has SSL support. And that's all it for the startup packet. Everything else from here on out uses this format, which is a little bit different than the previous one. It's first you send a character which describes what type of message that this is going to be, then the length, which again includes itself and then the rest of the body, whatever it is. And the same message format goes both ways. The messages that you send to the server as a client and the message that the client sends to you as a server. They all follow this format. The other point here is that because the length is only in N32, you can only have queries about the size on the order of a gigabyte. You can't have multi-gigabyte long queries because they'll be in the thing. Although I must say if you're sending individual queries that are that big, maybe something's wrong. Okay, so the next step is authorization authentication. Just as an example here to show you what one of these packets looks like. I'm gonna show this one more time. The rest of the time I'm just gonna do in code. But the message type four to say that I want to, or that the server sends us saying we need you to authenticate, it sends the character R and then the length eight because it's the N32 again and then it's one more number saying what authentication scheme we're gonna use. And there's, on the order of 10 different ways that Postgres allows, if it's a zero, it just means everything's okay. Either you didn't have to authenticate if the user was in trust mode in PGHBA, or you get okay once you've gone through the authentication through some of these other means. Type number three is clear text. I specifically don't support this, which I'll explain why in the next slide. And then the most common one is the MD5 password where it will send a salt and then you do like an MD5-based challenge and then send the answer back.  And so the reason I don't support clear text is because there's this possibility for this downgrade attack that you can have. And so real quickly the way that this works, like let's say you have a man in the middle attacker who's somehow on the line, maybe no SSL, who knows. So the client sends a sort of packet, the attacker just forwards it to the server. The server says, hey, I want you to authenticate with MD5. The attacker gets that, rewrites it, and it says, hey, I want you to authenticate as clear text. The client sends a secret password Hunter2 and then the attacker goes through the MD5 thing because it has the salt and then goes it and then authenticates. And now the attacker has gotten the clear text password and can authenticate as many times as they want. If your client instead doesn't support clear text at all, it'll say use the, when it says use clear text, it'll say, I can't do that and not divulge the password. Is this really a likely scenario? Like probably not, probably if you're not using SSL, you're inside your own network and so on and so forth. But I chose not to support it just because it's a little bit more security and I thought that was a good trade off. And also, I don't really think there's many servers that would support only clear text and not MD5 these days. And so I think dropping it makes a lot of sense. The MD5 thing, this is, you know, I could have made this prettier and expanded it out, but, you know, this actually was a little bit of a struggle to implement because it says the note here that keep in mind, the MD5 function returns as real as a hex string and that's true. But the way that Postgres expects this, in some cases it wants it as a string and in some cases it wants the raw bytes and figuring that out, which cases was which was very, I'd say, challenging. And so the way that works is you concatenate the password and the user together and take the MD5 of that as a string. And then you make a new MD5 and you give it that part but just the raw bytes.  And then you do the same thing with the four byte salt that the server gave. And then you take the string of that and prepend it with MD5 and then that's what Postgres is looking for to authenticate. And I really wanted to get this, this actually this thing was when I was thinking about how to put this talk together, I thought code would be a better resource because there's a couple talks out there that go into the protocol, you know, years past and then there's the docs but there's nowhere where it really shows you how to do the MD5 thing and then the rest kind of followed from there. So one of the new exciting features in the next version of Postgres is Scram. And this is similar to MD5 in that you do some calculations on the client and send that back. It's part of a larger family of authentication mechanisms called Sassel. And this has been an, this is exciting that it finally landed because it's been in work since late 2002, 2013 with Hakey and I think Michael Pacier helped a lot. And I'm very excited for this because it's a little bit more secure than MD5 but on top of that, it paves the way for another thing which isn't in there yet but it'll be hopefully maybe in Postgres 11 which is called channel binding. And this will allow you to connect over SSL and prove that you're talking to who you want without having to go through the trouble of setting up a certificate authority or getting your Postgres SSL cert signed by a real authority. This provides the same sort of way to know that you're talking to who you think you're talking to and get, you know, without going through all of that, which is very nice. And so Scram being in there now, I'm very excited for the future in that. And this works the same way as the other ones but it's number 10 instead of three and five and I assume that's because it's in Postgres 10 and not just because that was the next available number but that's what I choose to believe. All right, so now that we've authenticated, we get authentication okay and we start, Postgres will unsolicitedly send a ton of these startup parameter statuses and this tells the client everything about how the server's configured. Interger date times can be on or off. I'd be surprised these days to see many Postgres installations with it off. That means that the dates are stored as a float instead of a string which means that you have very high precision around Postgres' epoch time and then lower precision as it goes out. For a long time now it's been integer so it's a uniform precision. My thing, I don't support the float so if I see it say off, I just bail out and say like hey, use a different language and a bunch of other things that you can make sure that your client is prepared to accept what Postgres is gonna tell in the future. And then you get one more frame of a backend key data which includes a secret which we're gonna have to hold on to and memorize if you ever want to do query cancellation and I'll show you how that happens later on in the talk and then finally after all of this we get ready for query and this includes one byte of a character that says what state the transaction is in if it's idle or if you're in a transaction or if you're in a boarded transaction state and this is very useful for if you wanted to write a program like PG Bouncer and you wanted to know what state all of your connections are in if to pay attention to this message and this will come at the beginning when you connect and then every single time that you're allowed to send another query. Okay, so that was a lot. So recap, the front end can ask for TLS, gets a response and then establish SSL TLS if you want to. Then we send a front end, we send a startup packet which includes the database name, the user that we want to connect with, the role and then the server will ask for authentication we respond if necessary and then you get all of the server parameters, you get the secret and then finally we're ready to query. Yeah. Oh, so that's the secret in the, yeah, the secret there which we're gonna use later on if you want to cancel a query. And so there's, yeah. Which, oh, right. Okay, so yeah, that's a very good point. So, yeah, thank you. When I show code of how I'm reading from the server, I have this broken out such that I've already read the first byte and so I know which type of message it is and then I've looked at the length and I've then scanned through the socket and made a slice or an array of bytes of all of the data that's there and then that's available inside the bytes in my initialized length. And so the length did come and in this case it's gonna be eight, four for the N32 for the length and four for the character. But I'm sort of omitting that step because it's the same every time. It's harder to generate the length and I'm gonna show that every time we're gonna send a message but when we receive a message, I'm gonna assume that that's already taken care of and the data's already there. Thanks. Yeah. What language is that? This is in a language called crystal which looks a lot like Ruby but it's completely statically typed and statically dispatched and it's like 100 times faster. It's really good. So, and if you should use it and if you need to use Postgres, I gotta get a driver for you. But the talk's not. All right, so there's two different ways that you can send queries. There's simple and extended. The simple one is very simple.  Semicolons, you can run as many statements as you want. The downside is that you can have many statements. And this is bad for two reasons. One, you're only gonna get the data from the last query and two, it makes SQL injections attack worse because then the attacker can make as many statements as they want. Only allowing one statement doesn't, of course, prevent injection attack. You can still get some bad things, but at least it, you know, it's a small, it makes the problem just a little bit less bad. And because of this, in my driver, I discourage its use. It's still there if people wanna do migrations and stuff, but I specifically don't read any of the data. Like when the query happens, I just consume all the data frames and then just return nothing just to make sure that people aren't using this one when the other one works. So that's all I'm gonna talk about the simple query. The extended query is sort of where the Postgres protocol gets most of its power. You breaks everything down into multiple steps which can be reused. This is where query parametrization happens is where the dollar sign, one dollar sign, two comes from. And there's two concepts here. Prepared statements, which you're probably familiar with because this gets exposed a lot. And portals, which you may not be familiar with because this is more of a lower level thing. And so a portal represents a ready to execute query or a query that has partially been executed. You can resume it. So the steps here, we're going to send a parse message with the query and now Postgres will parse it, make a plan and so on. Then we send a bind message with all the parameters that we want to slot in. After that we need to describe the portal and this is how we know what data types are gonna be returned and what their formats and OID, object IDs are. Then we say execute and then it'll start to execute the thing and then we say sync to make sure that everything is on page and we can start receiving the data. The other interesting thing about this is even though we're doing the parse step first and the bind step second, we don't have to wait for Postgres to send the parse complete message and the bind complete message back. You can pipeline all these steps and just send them as fast as you can generate them and then start receiving the data later, which is nice. So the parse step, we're gonna send the character p, we're gonna do some calculations for length. The next slot where I'm just sending a null, if you wanted to save this prepared statement and reuse it later, you can give it a name. If you don't give it a name, you just send a null byte. We're gonna say, let's use the unnamed prepared statement and every connection has the sort of default unnamed slot. Then we pipe in the query and then you can say how many parameters that you want to specify their type and so, or and so that's if you have the two if you're gonna send $1 and $1 and $2 and you know what type you want Postgres to parse that as, you can go ahead and tell Postgres what object ID that is, or if you just say zero and then for the array later on that just send nothing, then Postgres will do its normal inference of what type and this is a little bit easier to deal with and so that's what I'm showing here. Bind, this is pretty straightforward, I don't think we need, I think you can read and understand all of that. No, I'm gonna go into the parts. And so it's not like, I mean there's a lot of steps that you have to send but it's not actually that complicated. We're gonna do some crazy calculations here for the size because there is so many things that we need to send. The character for bind is B and this is sort of, yeah, I could go into this detail but it's not that necessary to understand it. The next thing is two nulls. The first one is for the destination portal, again because we used, we're gonna use the unnamed portal which is similar to the unnamed prepared statement and because we're using unnamed prepared statement we say null for that one. If you were gonna rebind an existing prepared statement to give it new arguments, the second one in there is where you would slot in the name of that statement that you gave it before. Then we're gonna say the number of parameters that we're trying to send format codes for. Zero is text and one is binary. For this, I'm mostly using text for everything because this is what people are typing in except for binary for byday. But if you wanted to be a little bit more efficient about it you could send the binary versions of these things. And then almost done, we send the number of, again the number of parameters and then we send their sizes. And so for each one we send its size and then the actual data. And so the way this looks is we have, for sending five parameters we send a five and then for parameter zero we send its size and then its message and then the next size and then its message and so on. So that way Postgres knows how much to expect for each one of these things. Finally, we can say the return types we want. And this one is sort of where I have an issue with the protocol. Right now you could specify that I want the first result to be binary and the second one to be text and the next one to be binary. When I put this together I assumed that all the proper drivers were using binary because it's so much more efficient. Especially if you take example like a timestamp. If you send the text representative, the timestamp and then every single time in your application having that parse out the timestamp into its internal representation. And then I see a lot of tables with two or three timestamps updated at, created at. And if I'm sending all this data it has to, Postgres has to expand it out into a text string and then I have to read that text string and put it back into an internal representation that's happening over and over and over again. I thought obviously all of the drivers out there are using this binary result format because it's so efficient, they're not. There's like one Java one, one other driver I saw and then this one that are using this and the reason why is a lot of work as I found out, the binary formats for these data types aren't documented. You have to read the C code, which I'm glad I did it because it is pretty fast and that's nice but it's a lot of work. What would be nice is if I could say to Postgres when I connect, hey I support binary for these types, everything else. You keep track of it and send it correctly. But it doesn't. The, this next part could help with it a little bit so the next part is I do describe portal and this tells me what data types I get. Instead of saying P there for the portal I could describe the statement as an earlier step after I've sent it and that would tell me what types to expect. The problem is though that introduces a synchronization point where every single time I'm gonna have to, instead of me sending like all of my data for the query and then getting the results, I have to send part of the data for the query, wait, get a result and then proceed and that round trip is, it's not the end of the world but it introduces more a synchronization point for every single query which is hard to accept. And so this, when this comes back now we know for this query how many columns we're gonna get what data types the results are gonna be and finally we can say execute and again you could tell at the portal that you wanted. This part here, the maximum rows is a little interesting. It's separate from the limit that you would say in SQL. This tells Postgres only send me, if you gave it a 10, only send me 10 rows and if there are more rows what'll happen is it'll suspend that portal and then you can resume it later to get the rest of the data. This is something that I don't, there's not many people who use this. I imagine the main use cases if you are on like a limited memory and you only, for some reason you can't stream the results and you only wanna have a couple and then get a couple more and then get a couple more. I think JDBC does expose this and you can use it there but I have not used that feature myself but that's an interesting little used but possible feature there. And then finally we sync and then once this happens we can start receiving data and also the sync if there is an implicit transaction it'll close it at that point. All right, reading data. So when I send that description of the, please describe me this portal, the portal description what you get back is this row description which contains a lot of information. For every single field in the result type you get the name of the column, you get the OID for the column and the table if that result comes from a table and a column, if it's computed one like one plus one those won't be there. The type which is the most important one to know how to deal with that data. The size, the modifier, this is for if it's a VARCAR 255 versus a VARCAR 20 or something like that, that's where the modifier comes in. And then the format is similar to before it's a 01 if it came back as binary or text. And then I wrap that all in into a class so we can use it. Yeah. Where did the, you said everything's here except the computed column. So the computer columns will be here but the second thing there, column OID and table OID those will be zero because it doesn't come from a table. If it is a column that came from a specific table that it'll tell you that. This is something that again like I don't really see exposed much. I have it here just because it comes in the wire but like client application, I don't know that many reasons why you would necessarily need it but perhaps some of you are more creative than me and can figure out something to do with that but the data comes in and that's where it comes in. Okay, so now once we got that, so we've sent the query, we know what data to start expecting so we can start slotting, put some buckets in to start collecting rows. Now we're gonna read all the rows. And so what happens here is we want to look at the first character for the row to see to make sure that it is a data row because it's not gonna tell us necessarily how many rows to look, we just have to keep looking until we don't get a capital D and then we're gonna read the row and this will pull it off the wire which I'll show you next and then keep looping until we get a D until we don't get a D anymore and then the next one should be command complete and then after that we'll get ready for query again. And so to read the data row, again this is the same sort of format, we get the length, but that's not really necessary because once that data row comes in, we know how many columns are gonna be and then for each column we can, it shows the size of each information in the column and so the size is redundant because it's just the number of columns times each one of the things and so you have to read it off the wire but I just drop it on the floor at that point. This slice UN8 question mark thing is really the most complicated crystal specific thing and all that says is I'm gonna make an array of bytes that may or may not be nil, so it may be an array of bytes or it may be just a null or nil and then since I give it the number of columns it premakes the array of that size so I don't have to do any array growing things it just allocates that in one chunk and then inside it populates that automatically and then the thing here is if the column size, so it's gonna be column size and then the data then the size and the data and so on, if it happens to be negative one that means that the result was null in SQL and so if it's negative one we return null otherwise we read the bytes off and then go forward and that is really all there is to it to read data from Postgres. This is a little bit complicated with crystal specific stuff so if there's any questions here I'm happy to go into more detail but does that make sense? Okay, good. All right so that really is all there is to connect, issue a query and read the data. There's a couple of the things that will pop up and surprise you such as these async frames and they can come at any point. We've already seen one of them, the parameter status when we first connected, those are all asynchronous frames that can happen later on. If something changes on the server and one of those parameters change states like if someone changes the date format to something else it'll send unsolicited, it could be in the middle of the data thing, it could be in the middle of when you're trying to send it a query, anytime this will come in and you'll get another one of those key value pairs at any time. That doesn't happen too frequently but what can happen is errors and so an error comes in, again we read off the length and the error response is it has a code of what type of error it was and then it's a number of key value pairs of the information on the error and then the description and so on and so forth and so there can be a lot of these fields and these are all the field codes and you've probably seen some of these in your application, you've probably seen severity, you've seen message detail hint, this is where those come from when you have a Postgres error but it has a lot of other things, the position, the internal position, the position is how PCQL can place that little carrot underneath where your query is. A whole bunch of information here that you can make the errors really robust and especially if you are writing application and you wanna distinguish from a parse query versus something else, all that information can be found in here. Notice responses follow that same exact format but they're more for just warnings instead of full blown errors but they are formatted the same way, they have all the same fields and they can come again at any time and then also these asynchronous things are put together for how listen notify works and so these come in with the process ID of the backend and then next it has the channel name that you're listening on in case you're listening to more than one channel on your backend or in your front end and then the actual just payload data and so unlike the other ones which have a whole bunch of fields, for listen notify, all you get is the channel name and then whatever the payload happens to be. All right, so let's put it all together and see how this comes down. So we connect and we'll get authentication saying that we wanna do MD5, we'll come down, we sent the answer, we got okay and then we start getting a ton of parameter statuses which you've seen before and so on, we get our backend key data with the secret and that's an example of what one of the secrets might be and then we're ready for query. Let's send it select one plus one as two and high as hello. We get our parse complete, we get our bind complete messages that came in, we get our row description of the two rows and we have yeah, the row description of the two rows, their OID types and so on and you can see neither of them have the, the table OID is set to zero because none of these are coming from a table, that's the example from before and then we get command complete and that's where select one comes in and the number of rows is where you've seen, this is what PC will just prints when you're done, if you updated 20 columns, command complete in there would say update 20 and then we're ready for query again and we can send it and then you can print out a nice little table. If you select something that doesn't exist, you immediately get an error response and here's all the different error fields. So on position eight inside the query, you also get what file caused the exception on the server end so this has been parse relation.c if you were curious of where exactly in Postgres it was telling you you have an error and what line that was on and that's pretty cool and then we're ready for query again. There's just a handful of other small things, talked a little bit about query canceling, this is where you have the secret and what happens here is you actually make a brand new connection so the query could be on and so you can't talk to that back in anymore because it's doing something, you do another connection and you send it with a protocol version 80,887,102 which is very close to the SSL magic number and so this is one, two, three, four, five, six, seven, eight and so this must have come first and then they're like oh we need SSL so we'll just increment it by one. So that's where that comes in and so you send the startup packet and then you send the process you wanna kill and then the secret. This is, so you have the secret so you prove that you can kill that because again this is before any authentication and so if it didn't have that secret thing you could just run up to anyone's Postgres and start killing the back ends. You want to probably negotiate SSL first and then send this packet because if not someone could grab that and then just replay it over and over again and keep killing queries on your other backend until that backend's cycled and got a new PID and secret but you don't have to do SSL because you can just send this packet anything because again SSL is done as a separate step. There's copy mode. This is what PG backups uses and other things. If you issue a SQL command that enters copy mode you're gonna get a message saying if it's copy in it's a G, if it's copy out it's a H. Otherwise and then you get the length, the overall format, if it's binary or text, the number of columns and then if you're doing columns the formats and then you just start sending data packets. You're receiving data packets and unlike the previous one where it was overall size, size of the column, the data size of the column, it's data size of the column data, this is just all of the bytes just smashed up next to each other and then Postgres or you as a client have to take care of parsing that out and this is how copy can be so much more efficient because there's not all that framing data about expect this expect this. One it's a lot smaller on size and also you don't have to do as much processing. The downside of course is that you have to know exactly how this is going to line up. Another interesting little side bit here is the server will always send one row at a time in separate data packets but that's not necessary as a client. You can stop these data messages and pick them up at any point, even in between types, you can just send as many or as few of these as you want and Postgres will be set together but when it's sending you data to the client, it's a little bit nicer about it and does it in row chunks. I talked a little bit about my little bit of my rant on the binary format. The strings and numbers and stuff, those are very easy and straightforward which you'd expect. Numbers are always sent in network order so you're gonna have to swap them on most architectures but that's fine. The date and time that's microsecond since midnight January 1st, 2000. It's not 1970 as you might expect and I believe the reason they did that is because originally it was stored as floats and they put it a little bit in the future and so the precision around 1990s to 2010 would be higher and then it'd get fuzzier as it got out but then I forget exactly what version switched to default B by integers and so that's not really a problem anymore so I think that was a good trade off but it's an interesting why it's 2007, 1970. Numeric was a very difficult one to figure out how it was done. I encourage you, if you're interested at all, to go to the project and look at this. You have the end digits which is a number of, not digits in the thing but the number of int 16s at the end, a thing called a weight. The sign but not that kind of sign, I typed it wrong. The sign positive or negative or zero for not a number. Yeah, it's not doing like a sign or sort of thing. D scale is just where the decimal point will end up and then an array of int 16s but it's not packing it in to an int 16 representation. It's only using zero through 1000 or zero through 9999 and then it just pieces those digits together and then you have to make sense of that on your own. A couple more resources, the docs are pretty good. There's a presentation in 2014 that I relied on heavily when I was writing the driver and I tried to make this be complimentary to that information there, the PDF is very useful. And then finally, one of my former colleagues wrote a project called Fimibi which is a Go program. So we've seen front end and back end so that me is middle end and it's sort of, you can plop it in the middle and start manipulating the query, the things and sort of like inspecting and doing some things. He used it to make some project where it automatically graph data and queries just by sitting in the middle and like looking at it. And so that's an interesting thing. And yeah, thank you very much. Yeah, the question is on the binary formats, what kind of performance? The, for some types, it's fine. Like strings are represented the same but especially for date times because of all that saving parsing on both ends. I don't have like actual numbers I can quote you but it's really huge. And then also that combined with the fact that all IO in Crystal is evented in Async. Like just can like, and oh, just a little bit more about Crystal just because I like it so much. It's LLVM does all the compiler. And so it's leaning on 10, 15 years of LLVM optimizations to pull everything together and do some really crazy optimizations. And so, yeah, it's just really, really fast. I don't know, I can't, I don't have actual benchmark numbers but combination of the binary formats, the Async IO and then just LLVM being an amazing project makes this like pretty, pretty cool. Yeah, yeah. So the first part of the driver was not too bad because I just linked against the PQ. The data types were, you know, the next big work and then doing the protocol part was maybe, maybe only two months of, you know, like nights and weekends kind of thing. You know, again, because it's only 770 lines of code like there's not that much to it. Although there's still a couple missing parts that I don't support, but like you can get, you can get pretty far pretty quickly because as you've seen, like, you know, there's a lot of maybe details but the overall protocol is not that complicated. It's mostly character for the message type, the length and then some data. And, you know, there's a couple of gotchas in there that I hope this may help you avoid if you're gonna do this. But yeah, but it's a pretty straightforward thing. No, yeah, sorry, but I'm not, I just, I know that I've seen someone mention that. I haven't used it myself, so I can't. I don't know anything about the JDBC too much, but sorry. Thank you. Yeah, no, I've only used Postgres for a long time. I don't know, but yeah. All right, yeah, thank you very much.