MySQL comparable syntax for PostgreSQL

From: Ben Clewett <B(dot)Clewett(at)roadrunner(dot)uk(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: MySQL comparable syntax for PostgreSQL
Date: 2003-02-17 14:47:01
Message-ID: 3E50F5E5.5050107@roadrunner.uk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Hi,

I'm trying out PostgreSQL as an alternate to MySQL. Since MySQL seems a
little immature. There are however some constructs I am used to, and
can't see a PostgreSQL alternate. Can you let me know what the
comparable syntax is, if it exists...

The 'IF EXISTS' extension to CREATE and DROP TABLE. Is there something
similar in PostgreSQL to alow scripts to create/amend table to parse
smoothly without errors? -- Or something which can be added to a script
to instuct PostgreSQL to not thow an error if duplicate tables submitted?

An UNSIGNED number. Is this 'field INTEGER CHECK (field >= 0)', or is
there a direct UNSIGNED reference I have missed?

The AUTO_INREMENT extension to a Primary Key, as used in MuSQL. What is
the official method for auto-incrementing fields? I have found the
'DEFAULT NEXTVAL('...'), but I am not sure whether/how/if this can be
used to auto-increment a primary field?

The SET and ENUM data types, representing a set of, and enumerated data
respecitvelly. Is there anything similar, expecially to ENUM data type,
in PostgreSQL, as I use this extensivelly at the moment...

If anybody can let me know on what I am sure are simple questions, I'd
love to know.

Ben

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message guillermo schulman 2003-02-17 16:04:51 Change the current database programatically
Previous Message David C.Oshel 2003-02-17 14:37:31 Re: How to copy database