Query has not much helped.
As mentioned here, PostgreSQL is ORDBMS.
here, it explains PostgreSQL being RDBMS.
What does it mean that PostgreSQL is an ORDBMS? Is it about supporting user defined datatypes?
PostgreSQL is an object-relational database management system ( ORDBMS ) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. POSTGRES pioneered many concepts that only became available in some commercial database systems much later.
An object–relational database (ORD), or object–relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language.
Since their hybrid systems that don't exactly match the ideals of an object-oriented DBMS, they are called object-relational database management systems (ORDBMSs). Examples of ORDBMSs include PostgreSQL and Oracle (and, to a lesser extent, Microsoft's SQL Server).
RDBMS uses tables to represent data and their relationships whereas OODBMS represents data in form of objects similar to Object Oriented Programming. Following are the important differences between RDBMS and OODBMS.
An ORDBMS is primarily a relational database that supports some object oriented features.
PostgreSQL or Postgres (not PostGres) supports table inheritance and function overloading. Both are features usually attributed to object oriented languages.
One of the situations where the object-oriented approach is visible is the fact that for each table there is a corresponding data type created. So a table is essentially a set of "instances" of a specific type.
You can even explicitly define a table like that:
create type person_type as (id integer, firstname text, lastname text);
create table person of person_type;
Type inheritance is only supported for table types, not for base types:
create table person (id integer, firstname text, lastname text);
create table person_with_dob
(
dob date
) inherits (person);
This is however not fully object oriented because the type definition lacks the ability to defined methods on the type (=class) including method visibility. The closest thing to a type method is a function with that type as the parameter:
create table person (id integer, firstname text, lastname text);
create function fullname(p_row person) returns text
as
$$
select concat_ws(' ', p_row.firstname, p_row.lastname);
$$
language sql;
insert into person (id, firstname, lastname) values (42, 'Arthur', 'Dent');
Now you can run:
select p.fullname
from person p;
and it returns:
fullname
-----------
Arthur Dent
even though there is no column named fullname
in the table person. This behaviour is the closest to a real class/type method found in object oriented languages (but it's not the same thing as it still lacks the ability to define e.g. private methods)
Creating user defined structured data types is typically also seen as an object oriented feature:
create type address_type (city text, zipcode text, street text);
create table person
(
id integer primary key,
firstname text,
lastname text,
billing_address address_type,
shipping_address address_type
);
Arrays can also be seen as "sets of objects" however this is not necessarily an object oriented feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With