Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why postgres written by c not c++? is c has better performance or just a history reason? [closed]

Tags:

c++

c

postgresql

pg

I am learning postgresql source code

But I am curious about why situations is not written in c++.

Is it a history reason(just choose a c language)

Or maybe in some situations c has better performance than c++.

The world’s most popular databases, including PostgreSQL, MySQL, Oracle Database are coded in C

like image 385
user8152154 Avatar asked Oct 18 '25 09:10

user8152154


1 Answers

PostgreSQL has a long history. It was conceived as a successor to Ingres, which goes back to the 1970s. Although the first version of PostgreSQL was released to the public in 1996, papers about it were published as early as 1986, only a year after Stroustrup published The C++ Programming Language and the first C++ compiler became available.

So at the time the early versions of PostgreSQL were developed, C++ didn't properly exist yet.

like image 92
Thomas Avatar answered Oct 21 '25 00:10

Thomas