What was the relationship between Whitebeard and Roger? Indeed, they have a peculiar relationship. Towards the end of the battle at Marineford, he had a fashback to some time he spent with Roger, and how he was not interested in Raftel at all even if Roger told him where it was. How come then, that earlier than that, when Shanks confronted him about stopping Ace from the pursuit of Blackbeard, he admitted that they used to fight a lot with Roger's ship.

Yes we know no pirates have any proper relation, but would someone like Doffy have a cup of tea with Crocodile at all? Not to mention the enormous secret Roger was just about to reveal so casually.
They're just friendly rivals. Similar in vein to Shanks and Mihawk.
Knowing Roger (he had a similar personality as Luffy, noted by Rayleigh and Shanks himself) he was free spirited. If there was a Yonko at that time that would be Roger, Whitebeard, and Shiki. The only difference was Roger rose to the top and became Pirate King before his execution.

Being the top dogs during their era, it's without question that they would engage each other in fights against each other but end up settling it with a laugh after the fight. Roger trusts WB and likewise, WB trusts Roger hence the drinking scene.