Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5
Дата
Msg-id CAKFQuwaqY25K7bGFXH0Szj9GCSfR84ATbPpDiyrJAQNMQr9Beg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5  (rob stone <floriparob@gmail.com>)
Ответы Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5
Список pgsql-general
On Wed, Dec 14, 2016 at 5:12 PM, rob stone <floriparob@gmail.com> wrote:

On Wed, 2016-12-14 at 17:00 -0700, David G. Johnston wrote:
> On Wed, Dec 14, 2016 at 4:49 PM, Patrick B <patrickbakerbr@gmail.com>
> wrote:
> > ERROR:  function logextract(integer, integer) does not exist
> > LINE 1: select logextract(20160901,20161001);
> >
>
> So change the constants you are passing into your function to text
> (i.e., surrounding them with single quotes) so it matches the new
> function signature.
>
> There exists an element of understanding the options you are being
> given and adapting if something basic like this is overlooked.
>
> David J.


1) Have you run a \df+ and made sure the function has been created
correctly?

​It was created originally using integer arguments - and thus was being called that way.  It was intentionally changed to use "text" arguments per a suggestion but without any recognition that the call site needed to change as well - hence the error.​  Running \df+ would give the expected output.  What could be a problem is if the original function wasn't dropped so while the text arg'd one was created the actual call would still reference the old int arg'd version and any changes would not appear to have been made.


2) In your first post there is a single apostrophe after the execute
instruction. Can't see the closing apostrophe but then my eyesight is
not the best.

​I'd recommend using the "format" function but last time I did that the person I way trying to help got mad...​


3) I've always found it easier to TO_CHAR a date column when using it
for comparison purposes.

​I'm not following this "use text" approach at all...​I get the logistics but PostgreSQL allows for comparison of date typed data...

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5
Следующее
От: Patrick B
Дата:
Сообщение: Re: [GENERAL] Plpgsql - Custom fields Postgres 9.5