Learning PostgreSQL: The Tools

AWS, PostgreSQL, RDS
In case you don't know, I've been writing a series of articles over on Simple-Talk as I learn PostgreSQL. It's all from the point of view of a SQL Server person, expanding into a new technology. In other words, a true story. I thought I'd take a moment here on my own blog to talk about the tools I'm using and why I chose those. AWS RDS Let's establish up front, I'm lazy. Very lazy. So yeah, I'm trying to learn this new technology, but I'm going to find as many ways to use the knowledge, skills & tools I already have as I can. Now, I first started learning PostgreSQL because I wanted to learn more about how Flyway works. Further, as I also needed to learn how to…
Read More

Thank You Tim!

Uncategorized
Ah, Tim Ford. I remember the time we were sitting at Ruth Kriss Steakhouse trying to figure out which of the two of us was the dumbest person in the room. Just so we're clear, it was me. Anyway, we've been friends for a long time. Thanks Tim! Thanks for being insane enough to think that teaching tech on a cruise was a good idea. Then, being so utterly 'round the bend that you actually did it. Multiple times. Successfully. And I got to take part in it. Thank you Tim! Like with Wendy, there are no words to express how I feel about our time on the PASS board. Thank you. We've spent so much time together, honestly, it's hard to pick out all the ways you've been kind…
Read More

Database Fundamentals #32: Create Unique Constraints with T-SQL

Database Fundamentals, SQL Server
In the last Database Fundamentals post, I explained what a unique constraint was and how you can create them using the GUI. Using TSQL to create a constraint is very similar to the primary key and foreign key constraints that you created in this post. You can use either the ALTER TABLE command or create the constraint when you make the table with the CREATE TABLE command. Using CREATE TABLE to Make a Unique Constraint There aren’t any new tables we need for this post, so we’ll create a table that we can drop immediately as soon as we’re done experimenting. You should already be familiar with the CREATE TABLE statement (or follow the link above): CREATE TABLE dbo.ConstraintTest ( TestName VARCHAR(50), CONSTRAINT UniqueName UNIQUE (TestName) ); This script creates…
Read More

Thank You Wendy!

Uncategorized
I honestly don't know when or how I met Wendy Pastrick, but I'm so happy I did. Wendy and I have been friends for a very long time. Thank you Wendy! I think the biggest thing I can say about Wendy is that she builds communities. I suspect no one knows just how much she has done, behind the scenes at her local events in Chicago, at the national and international level, all to get people together to share & learn from one another. Wendy has been one of the guiding lights and foundational persons, and I know, not enough people are aware. For almost literally toiling in darkness, thank you Wendy. Wendy and I have not shared a technical track the way I have with others. Her specialties &…
Read More

Sabbatical!

Professional Development
Redgate Software has a policy wherein every 5 years, employees receive a 6-week paid sabbatical. Well, I'm up to year 11 (I skipped a year my first time), so it's that time for me. First, thank you Redgate. I've loved working for you for 11 years. I'm looking forward to just as many more. Second, I've already written and scheduled a bunch of blog posts, so you'll still be seeing activity here. Third, I'm supposed to completely disconnect, but I won't. I'll be checking email, posts & messages, but I'll be slow on the response. Apologies if I don't get back to you quickly. See you in 7 weeks (I tacked on some vacation time. HA!).
Read More

Thank You Allen!

Uncategorized
I know I can say that I'm a friend of Allen White without getting into trouble. Allen and I have a shared a lot of things over the years and I'm inordinately pleased that I know the man. Thanks Allen. Allen was the very first person, ever, to say to me "Say, aren't you Grant Fritchey? You wrote that book on Execution Plans." To say I was blown away that anyone, anywhere, would recognize me, well, there's simply no way to understate this. Thank you, Allen, for the recognition. Allen has always been one of the clever ones. He was up and using Powershell almost before it was released, or so it seemed. When I was just barely starting to figure out the kind of automation I live by now,…
Read More

Extended Events for Anything But Query Tuning: xml_deadlock_report_filtered

SQL Server
One of my favorite little bits of information about Extended Events is the fact that everyone running a full instance of SQL Server has deadlock information available to them, even if they never enabled Trace Flag 1222 through the system_health session. That captures the xml_deadlock_report which has the full deadlock graph. However, what if you want to capture deadlock info, but, you're dealing the GDPR, and transmitting query values could be problematic? Enter xml_deadlock_report_filtered. xml_deadlock_report_filtered If you do a search for this event, you're not going to find much. Doesn't seem like anyone, including Microsoft, has bothered to document it. This is not going to be a comprehensive definition for all things xml_deadlock_report_filtered. However, I can show you why you might want to use it. This is a port of…
Read More

Goodbye to Good Morning!

Professional Development
For two years and three months, since April 2020, I've posted a tweet saying "Good Morning!" on every workday. I think I missed one. I was late for a couple. The messages were meant to be helpful. I used the word kind a lot. A lot. I tried to avoid lectures, and still did it sometimes. I tried to always be uplifting and positive, yet was still a downer occasionally. I've received many thanks for the tweets, in public and private. I cherish every one. Thank you! I also received quite a few "how dare you" and "you're not qualified" messages. For those, my answers are simple. I dare fine. You're right, I'm not qualified, doing it anyway. However, I'm drawing all that to a close. See, I'm going on…
Read More

Thank You Kevin!

Uncategorized
I don't think I'm going too far out on a limb to call Kevin Kline a friend. I'm extremely humbled and honored that I can say that. Kevin is just a good person. Thanks, Kevin. Years ago, on a guess, about 12-13, I was talking with Tom LaRock, another great guy, and we both said, "Damn, I wish I had Kevin's job". Kevin has been an evangelist/advocate for a few different organizations over the years. Within a year, Tom did. About another year after that, so did I. However, Kevin lead the way. He showed us what a good advocate looked like. Thanks Kevin. I wouldn't have my outstanding job if it weren't for you showing me how. Kevin was also one of the founding members of what was the…
Read More

Extended Events for Anything But Query Tuning: Unique Constraint Violations

SQL Server
Most of the time when I talk about or demo Extended Events, I spend more time talking about query tuning (I have a problem). However, there are tons of things that you can do with Extended Events. Here's a little one that came up, auditing unique constraint violations. Unique Constraint Violations Whether we're talking a primary key or just a constraint, the error you get is number 2627 when you attempt to add a non-unique value. So, the code for a simple way to track this in Extended Events would look like this: CREATE EVENT SESSION [UniqueConstraintViolation] ON SERVER ADD EVENT sqlserver.error_reported (WHERE ([error_number] = (2627))); That's it. That's all you need. Probably, it'd be a good idea to output this to a file (that's usually what I do). However,…
Read More