Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjVIH-0001lr-FE for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2019 20:58:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjVIG-0004ju-AX for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2019 20:58:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjVFM-00010Z-Sj for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2019 20:55:57 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjVFI-0000zN-Uq for pgsql-general@postgresql.org; Fri, 05 Jul 2019 20:55:55 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id F081F418; Fri, 5 Jul 2019 16:55:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 05 Jul 2019 16:55:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=P sHXSecwR2m+hrs52J9IHDU0hVHzCS7l5z0FGqhI8S0=; b=pPWr2ocAgg5tAnhzG CWT0S2GYt57t4fTzOaumrT7BTtwIBNRWdP742jrRlfly/Uv1ezl8sNo44Ob4EVzp N1pJL7eD4JcMUEBr8E5wyyOj/hQIG1ZARcdKfcunjlG3hDSOKP/Xjr8gteKHUw2d Lhko50zETjNFS8gHacAr/1R7RKLsFTP7ZN8H8mXs1ZXT0B326/lqHbxBV1TJ6Pn4 O1CVKdspz5CKxp2+FisNkUC2t9FHlgogIhbOuYDWJpVexO9ldVI1P958dmQxFwN1 0/HM8U2oC99R1MHH/BZmkl1r/eUqvG6AlGmcozvtwboAvnJxuhfQpSSBQip7vyip hLr5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=PsHXSecwR2m+hrs52J9IHDU0hVHzCS7l5z0FGqhI8 S0=; b=Xpy1sFuEx0Rna1pRwGls4o6Ds6Zy8mKTfzTqhYDuf/+vk3eZVHURpczrB hy/g7aBIs01wwdKgh2TYhTjBb47OPuyQS3idwQpxA9Cz+7JbLyIlEyOJ4QNVktDD m9h9LhD4HO3/fEPg682XuokfjoCoTgBjebXIILoF+jxkGSuHBuq/F4fcl+/KwKy6 Zsza6YvyPfyVRIWg7VvbWIyTnuH1D5UJ+Fhm1bZ/j/XtoynP5rSQIf+VXv4T6tv1 CRtzjJ2OxvMelQ7G7s9PE9Z9Q/iGrk8KvgVIfkWRIS3VjGzKKTlBihKGK4pgs+4B eKLaMkTh3FQbM5fXS5lJEiJZpbuWA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrfeeggdduheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdqrghrtghhihhvvgdrohhrghenucfkphepjedurddvuddvrddugeefrddvudelnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvg hrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (unknown [71.212.143.219]) by mail.messagingengine.com (Postfix) with ESMTPA id 99F28380076; Fri, 5 Jul 2019 16:55:49 -0400 (EDT) Subject: Re: Converting to identity columns with domains on PK columns To: PegoraroF10 , pgsql-general@postgresql.org References: <1562269287792-0.post@n3.nabble.com> <9dcaef4ca4f464078c22d4658eabd6baf43f9940.camel@cybertec.at> <1562326734199-0.post@n3.nabble.com> <81ddd3d0-bfb0-f52e-318c-622ab8e9fa9b@aklaver.com> <1562356860333-0.post@n3.nabble.com> <25356.1562357780@sss.pgh.pa.us> <1562359797649-0.post@n3.nabble.com> From: Adrian Klaver Message-ID: <70ed1dae-5697-e7cf-5158-cbf231339c40@aklaver.com> Date: Fri, 5 Jul 2019 13:55:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1562359797649-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/5/19 1:49 PM, PegoraroF10 wrote: > Sorry, the example I was thinking was this one, which works on Firebird, > using its way of writing, obviously. > > create function myproc(id integer) returns I32 language sql as 'select $1'; > > On postgres ERROR: return type mismatch in function declared to return i32 > > What I mean is that Firebird sees I32 and integer as the same, Postgres > doesn´t. Yeah, but if you reverse the casting you did in your first example it works: create function myproc(id integer) returns I32 language sql as 'select $1::i32'; CREATE FUNCTION test_(aklaver)> select myproc(5); myproc -------- 5 (1 row) test_(aklaver)> select pg_typeof(myproc(5)); pg_typeof ----------- i32 (1 row) > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html > > -- Adrian Klaver adrian.klaver@aklaver.com