pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: George Woodring <george.woodring@iglass.net>
To: pavel.stehule@gmail.com
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Plpgsql search_path issue going from 9.3 to 9.6
Date: Tue, 13 Nov 2018 06:43:20 -0800
Message-ID: <f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com> (raw)
In-Reply-To: <CACi+J=Q1q6vvYBGeFHR-rNpq4A1J3AX6nsv7TnOB7DdjtubM5w@mail.gmail.com>
References: <CACi+J=TiP-mLHTe9EY=pi8Y1JwnhggKLGWbaRU19txdd1tVCow@mail.gmail.com>
	<CAFj8pRCuA29y=VfT9wGMWDW32-7aNOiPZs3VqkyXWp0ff7wN5w@mail.gmail.com>
	<CACi+J=Q1q6vvYBGeFHR-rNpq4A1J3AX6nsv7TnOB7DdjtubM5w@mail.gmail.com>

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 <http://www.iglass.net;
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (11+ messages)  latest in thread

Message-ID: <f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com>
Permalink:  ../f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com/
Also on:    postgresql.org/message-id/f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, george.woodring@iglass.net, pavel.stehule@gmail.com
  Subject: Re: Plpgsql search_path issue going from 9.3 to 9.6
  In-Reply-To: <f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com>
  References: <CACi+J=TiP-mLHTe9EY=pi8Y1JwnhggKLGWbaRU19txdd1tVCow@mail.gmail.com> <CAFj8pRCuA29y=VfT9wGMWDW32-7aNOiPZs3VqkyXWp0ff7wN5w@mail.gmail.com> <CACi+J=Q1q6vvYBGeFHR-rNpq4A1J3AX6nsv7TnOB7DdjtubM5w@mail.gmail.com> <f031a511-bd49-e541-f61d-4c993047baeb@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox