Re: About rpm database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/29/06, Chowdhury, Chandan Dutta <chandan-dutta.chowdhury@xxxxxx> wrote:
Hello All,


First of all, an rpmdb is a hierarchical database using Berkeley DB.

I have 2 questions for you

1. Can any one point me to a document describing the structure of RPM
database?
This what all tables are present in the RPM database, what all columns
in them.


First of all, an rpmdb is a hierarchical database using Berkeley DB.
So no SQL, no rows, no columns, no tables.

Headers are stored as blobs in /var/lib/rpm/Packages, the key is a monotonically
increasing integer. The current largest values as retrieved and
incremented in a RMW
operation using key = 0 whose value is the largest key in the rest of
Packages. The
key for the header blob in Packages is known as a "header instance".

All the other indices are inverted lists of certain tags stored within
a  header.
That means that the value from the tag is used as a key to retrieve a
varibale length array of (header,element) indices. In most cases, the
element index is 0.

One can replace a Berkeley DB with sqlite3 for an rpmdb, but the
rpm-4.4.2 that most vendors are choosing to distribute has known
problems with the implementation in 4.4.2.

2. Is there a CLI for doing SQL queries on the RPM db, if so plz provide
me the link where I can find them.


No SQL, the CLI for accessing an rpmdb is the --query mode of rpm.

Hint: Export all the data from an rpmdb for importing into whatever
SQL db you want
by doing
   rpm -qa --xml
or
   rpm -qa --qf '[%{*:xml}\n]'

73 de Jeff

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux