Re: couple of general questions - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: couple of general questions
Date
Msg-id Pine.LNX.4.30.0101192142530.1322-100000@peter.localdomain
Whole thread Raw
In response to couple of general questions  (Culley Harrelson <culleyharrelson@yahoo.com>)
List 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@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: "Martin A. Marques"
Date:
Subject: re-instalation
Next
From: "Martin A. Marques"
Date:
Subject: Re: re-instalation