Re: converting microsoft sql server 2000 sql-code for postgresql

From: "Wei Weng" <wweng(at)kencast(dot)com>
To: "Guy Fraser" <guy(at)incentre(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: converting microsoft sql server 2000 sql-code for postgresql
Date: 2003-01-29 04:39:47
Message-ID: 003e01c2c750$74087e60$2f437242@PASCAL
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

What about a UNIQUEIDENTIFIER type?

Is the only way casting it to a CHAR(38)? (Create a domain for it)

And does the performance suffer if I do the Domain/create my own data type
tricks?

Thanks!

Wei

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Guy Fraser" <guy(at)incentre(dot)net>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Tuesday, January 28, 2003 8:55 PM
Subject: Re: [SQL] converting microsoft sql server 2000 sql-code for
postgresql

> Guy Fraser <guy(at)incentre(dot)net> writes:
> > If you go through the documentation you can also find out how to CREATE
your
> > own data TYPE to allow more direct use of non-PostgreSQL data types.
Here is
> > an example that will allow input of any "datetime" data into PostgreSQL
:
>
> > CREATE TYPE datetime AS (datetime timestamptz);
>
> I think what you probably really want is
>
> CREATE DOMAIN datetime AS timestamptz;
>
> or more SQL-spec-compliantly
>
> CREATE DOMAIN datetime AS timestamp with time zone;
>
> which essentially makes datetime a direct alias for timestamptz. The
> CREATE TYPE approach makes a rowtype containing one timestamptz column,
> which isn't really going to act the way you want --- for one thing,
> none of the predefined functions and operators for type timestamptz
> will accept it. With the DOMAIN approach, they will.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Vecernik 2003-01-29 05:50:42 Re: CSV import
Previous Message Agnieszka Rutkowska 2003-01-29 04:25:39 extracting constraints from schema