Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 84762479703 for ; Wed, 29 Jan 2003 00:10:31 -0500 (EST) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by postgresql.org (Postfix) with ESMTP id 42CDB47978A for ; Tue, 28 Jan 2003 23:38:32 -0500 (EST) Received: from PASCAL (p67-47.acedsl.com [66.114.67.47]) by mail1.acecape.com (8.12.2/8.12.2) with SMTP id h0T4cTJ6012633; Tue, 28 Jan 2003 23:38:29 -0500 Message-ID: <003e01c2c750$74087e60$2f437242@PASCAL> From: "Wei Weng" To: "Guy Fraser" , "Tom Lane" Cc: References: <000901c2c6b5$2deef350$240aa8c0@L1PC01> <200301281728.16020.mallah@trade-india.com> <3E36FCF0.5060305@incentre.net> <16682.1043805324@sss.pgh.pa.us> Subject: Re: converting microsoft sql server 2000 sql-code for postgresql Date: Tue, 28 Jan 2003 23:39:47 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/464 X-Sequence-Number: 11329 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" To: "Guy Fraser" Cc: Sent: Tuesday, January 28, 2003 8:55 PM Subject: Re: [SQL] converting microsoft sql server 2000 sql-code for postgresql > Guy Fraser 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 > >