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 1gMZue-0006ps-EE for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 14:43:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMZuc-0007Yw-Th for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 14:43:30 +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 1gMZub-0007Yo-Tk for pgsql-general@lists.postgresql.org; Tue, 13 Nov 2018 14:43:30 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMZuV-0006EW-9z for pgsql-general@postgresql.org; Tue, 13 Nov 2018 14:43:28 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4F5B82222B; Tue, 13 Nov 2018 09:43:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 13 Nov 2018 09:43:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=x m/0qGiMNWc6YOKRtJGFnSUu4ySwO4lxm0wIfAawsNE=; b=kmiUNv9n18i8+XZsz 8nVmQ+g3KUvE025RuL2gp4NCl/24CZCguP6EY8CdLsrDiBlcuWEbvRsUDGQupDVE iZy/v6eN/9nREvHYq1XG9AztSFG3MWPZLmBUFIP1zjLeaYxclNYVqnBLbPnjN5hs AihKNp2F3gSHgqlqdPVKN2fgCVp4quXUPEyIpm+y1va2j43e2W2UQKDCP+pD6DEz zZTcOeAtud8l1NtTsIJcWeBEEtWmZePNzE4BPuUttej5OcA5xe/5XQDduN5jfaSP vaqS1YmtRvmThnjvwh6EntN2GpPWGC4jMHOsoHgYLYVYaBy6owUen7H2Yq+xQnOQ diRcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=xm/0qGiMNWc6YOKRtJGFnSUu4ySwO4lxm0wIfAaws NE=; b=YxcbQrlr7slY+ItSURwGcAQXPJkdGTbcrWUEl6w02qN7DkyXWLH0kzajr wVKUpb2xMeGX1kHLUGDjqxj+P5j2gRHvjIffUvCECbs+XJ7VnEGsp25Kyp/wRrOe GsuiQ2LT2mgFoIj2roGWYBMIfiAmXVup3rCN/ZW6HF9l7T1HxVlifP0avEBwniG0 9h0LT6zG5LF7mvj1D9o27OXoKfZD7i8hZPX/QXI1YD2mS59vjLnQl5qTeJy8FILH jBb/SwQ2VCPsRadmqNnpaqIIC6W/+slqLViHCJcX81lVEta8fTzOpfnrEquKCTep c1lNfFoMH+oTLnsFuPOxc49ehoR3g== X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 24C04E4307; Tue, 13 Nov 2018 09:43:21 -0500 (EST) Subject: Re: Plpgsql search_path issue going from 9.3 to 9.6 To: George Woodring , pavel.stehule@gmail.com Cc: pgsql-general References: From: Adrian Klaver Message-ID: Date: Tue, 13 Nov 2018 06:43:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: 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 11/13/18 6:27 AM, George Woodring wrote: > I think the issue is that the function is not putting the data into the > tickets%ROWTYPE correctly.  When I do \d on public.tickets and > iss-hackers.tickets, the columns are in a different order. That is because you have a table tickets in the public schema and a view tickets in the iss-hackers schema. Is that what you really want? > > \d public.tickets >     Column    |           Type           | > Modifiers > --------------+--------------------------+------------------------------------------------------------- >  ticketsid    | integer                  | not null default > nextval('tickets_ticketsid_seq'::regclass) >  opendate     | timestamp with time zone | default now() >  state        | smallint                 | default 1 >  opentech     | character varying(50)    | >  priority     | smallint                 | default 10 >  severity     | smallint                 | default 30 >  problem      | character varying(300)   | >  summary      | text                     | >  parent       | integer                  | >  remed        | boolean                  | default false >  remed2       | boolean                  | default false >  remed_hstart | timestamp with time zone | >  autoclean    | boolean                  | default false >  remoteid     | character varying        | >  remotesync   | timestamp with time zone | >  sla_time     | interval                 | >  sla_alarm    | boolean                  | > > \d iss-hackers.tickets >              View "iss-hackers.tickets" >     Column    |           Type           | Modifiers > --------------+--------------------------+----------- >  ticketsid    | integer                  | >  opentech     | character varying(50)    | >  summary      | text                     | >  parent       | integer                  | >  opendate     | timestamp with time zone | >  priority     | smallint                 | >  problem      | character varying(300)   | >  autoclean    | boolean                  | >  state        | smallint                 | >  severity     | smallint                 | >  remed        | boolean                  | >  remed2       | boolean                  | >  remoteid     | character varying        | >  remotesync   | timestamp with time zone | >  sla_time     | interval                 | >  sla_alarm    | boolean                  | >  remed_hstart | timestamp with time zone | >  tableoid     | oid                      | > > > The error message is saying column2 is not a timestamp, which the public > table is a timestamp for column2.  If I change my SELECT in the function > from SELECT * to SELECT opendate  I can fix my issue easily. > > George > iGLASS Networks > www.iglass.net > > -- Adrian Klaver adrian.klaver@aklaver.com