Re: couple of general questions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Culley Harrelson <culleyharrelson(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: couple of general questions
Date: 2001-01-19 20:47:52
Message-ID: Pine.LNX.4.30.0101192142530.1322-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Culley Harrelson writes:

> 1. Is it possible to use syntax like "if object
> exists then drop it" before running your ddl
> statements? Which system table do you hit?

There is no such syntax. You just use DROP and ignore the error message
if appropriate.

> 2. In the documentation it says that of the character
> data types text is best, over varchar().

I think the text type was carried over from the old Postquel language
whereas the varchar type was added later for SQL compliance. All in all
there isn't much difference between them.

> What if any are the benefits of using an array data
> type over, say, a child table holding all the values
> of the array?

Don't use arrays.

> 3. OK the CLUSTER statement. Say you cluster on the
> last name of an employee table. When you then do an
> insert into this table for someone named Smith is the
> record logically written between the R's and the T's?
> Just need to verify this is right :)

No. The CLUSTER only affects the existing data. New records are appended
to the end until the next CLUSTER.

> 4. Lastly I wanted to confirm that the best way to
> regularly run a piece of sql is to schedule a OS
> script to handle it. Is this right?

A cron job, sure.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2001-01-19 21:21:29 RE: Delete and self-join
Previous Message Martin A. Marques 2001-01-19 20:40:41 Re: re-instalation