Search Postgresql Archives

Re: Dry run through input function for a given built-in data type

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

 



On Tue, May 12, 2015 at 11:23 PM, Fabio Ugo Venchiarutti <fabio@xxxxxxxx> wrote:
Is there any cleaner way to, say, only run the validation part of a type input function
​ [...]​

​This pre-supposes that said type input function has a distinct validation phase as opposed to simply performing its parse and failing when it encounters something it cannot handle.

​I would suggest you attempt to separate the non-context-aware stuff and the context-aware stuff into two separate phases; and only data that passes the non-context-aware tests would then be bundled up into the full CTE where you then check constraints and the like.​  The how is beyond me but this is an open source project so you have access to all of the relevant functions.  How you would go about using them without having to invoke the engine I do not know but that seems like the only performant option since the PostgreSQL executor isn't designed to handle your usage pattern.

Without considerably more understanding of the how suggestions are difficult to make - even were I to know the innards of PostgreSQL and using C.  Others more knowledgeable will likely chime in but I suspect that I'm pretty close to the mark on this one.

Yes, you could make a regexp-base validation library...but that screams "maintenance nightmare" to me.  I'm doubtful such a thing already exists.

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