Search Postgresql Archives

Re: Using row_to_json with %ROWTYPE ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 6, 2015 at 10:23 AM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> 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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux