Re: Using row_to_json with %ROWTYPE ?

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Using row_to_json with %ROWTYPE ?
Дата
Msg-id CAKFQuwZd=6TPtTaFwFbc3mrioRd=GP_xYpyLLdrBQuR7k0ZdFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Using row_to_json with %ROWTYPE ?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Fri, Feb 6, 2015 at 10:23 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

CREATE FUNCTION validateSession(session_id char(64),client_ip
inet,user_agent char(40),forcedTimeout bigint,sessionTimeout bigint)
RETURNS json AS  $$
 
CREATE OR REPLACE FUNCTION public.validatesession(s_id character, client_ip inet, user_agent character, forcedtimeout bigint, sessiontimeout bigint)
 RETURNS json


​As an aside, and going from memory, you will note that Adrian kept the "character" type in the function signature​
 
​but removed the length specifier.  PostgreSQL does not store that information and so will not prevent a call from passing in a string longer than 64 characters into the function.  This applies to any specification in () following a type declaration (say for numeric or timestamptz)

David J.


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Using row_to_json with %ROWTYPE ?
Следующее
От: Tim Smith
Дата:
Сообщение: Re: Using row_to_json with %ROWTYPE ?