Re: [GENERAL] DDL for postgres database

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: pgsql-general(at)postgreSQL(dot)org, nyang(at)bbn(dot)com
Subject: Re: [GENERAL] DDL for postgres database
Date: 1998-05-24 09:04:30
Message-ID: l03110701b18d9130e166@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 6:42 +0300 on 24/5/98, The Hermit Hacker wrote:

> Hi,
>
> I have used postgres for our application.
> Our customer is asking us to give them the DDL (data definition
> language) files for the database.
>
> I don't know what the customer means and feel awkward to ask them.
> May be someone could give me a hint?
>
> If anyone knows what DDL means for the postgres database,
> please let me know ASAP. Thanks a million.

DDL (Data Definition language) is the part of SQL that has to do with the
definition of the data structure, as opposed to queries, insertions and
updates, which are called "Data manipulation language", if I'm not mistaken
(it is less commonly used).

In practice, this basically means all the "CREATE TABLE", "DROP TABLE",
"CREATE SEQUENCE", and I think also "CREATE INDEX", "DROP INDEX", "GRANT",
"REVOKE". In short, anything which is not "SELECT", "UPDATE" or "INSERT".

To give your clients the DDL files, what you need to do is:

pg_dump -S _database_name_

(Replace _database_name_ with the name of the database).

It would be preferable if you created the database originally using SQL
files. It's more orderly that way. You should have comments in files like
that, for example. Also, you usually use only the parts of commands like
CREATE SEQUENCE which interest you. The result of the above pg_dump gives
you all the parameters, including those which are not really relevant for
your application. However, if you just created the database and changed it
on the fly, the pg_dump will have to do.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jose' Soares Da Silva 1998-05-25 10:29:17 Re: [GENERAL] Privileges
Previous Message The Web Administrator 1998-05-24 05:20:39 Re: [GENERAL] Privileges