Databases: PostgreSQL: does Moodle use OID's or large objects?

Databases: PostgreSQL: does Moodle use OID's or large objects?

by René Pijlman -
Number of replies: 2
I've installed Moodle 1.7 on a Linux server using PostgreSQL 7.4 as the database. I'm setting up an automatic backup script at the database level.

There are two application-specific caveats with PostgreSQL's pg_dump script:
  1. pg_dump does not dump large objects by default
  2. --oids: Dump object identifiers (OIDs) for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.
So my questions are:
  1. Does Moodle store large objects in a PostgreSQL database?
  2. Does Moodle use PostgreSQL's OID columns in any way?
Average of ratings: -
In reply to René Pijlman

Re: Databases: PostgreSQL: does Moodle use OID's or large objects?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

> Does Moodle store large objects in a PostgreSQL database?

As far as I know, Moodle doesn't use any large objects.

> Does Moodle use PostgreSQL's OID columns in any way?

None that I'm aware of smile

I've done a couple of pg_dump/pg_restore processes in a live (i.e. production) server without any side effects (using 1.5 & 1.6 versions of Moodle, can't comment on 1.7 where the db layer has changed quite a bit).

I've done the backups using:

pg_dump -Fc -o -f moodle.db moodle

(where 'moodle' is the database instance name) and restored it with:

pg_restore -d moodle -c moodle.db

(I had the database already created, so I just needed to restore the contents, hence the '-c' flag).

I've said Moodle doesn't use the OIDs in any way, but I dumped them anyway (hence the '-o' flag for pg_dump).

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: Databases: PostgreSQL: does Moodle use OID's or large objects?

by René Pijlman -
Thank you Iñaki.

I've checked Moodle's lib/db/postgres7.sql and I see no mention of OID's in the schema, so I don't think -o is necessary.