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

Re: [PATCH 2/2] Modify upgrade_bibtex.sql: Create function bibtex_debian_pool() which gets references for sources present only in the Debian Package Pool



Hi,

On Thu, Apr 23, 2015 at 07:01:55PM +0530, Akshita Jha wrote:
> >
> > Just had another view:  I think the code duplication in
> > bibtex_debian_pool() is a bit hard do maintain.  Why not defining
> > it as
> >
> >    SELECT * FROM bibtex()
> >      JOIN ...
> >
> > ?
> I had thought of this but then I realised that bibtex() "RETURNS SETOF
> TEXT" in the latex syntax. Will join will work on this ?

For sure not - I was a bit quick.  However, to save my idea to avoid
code duplication what about a helper returning a table

   source   text,
   bibentry text

and use this helper in both functions that just return the bibentries.
I'm just afraid that we might change anything later and will forget to
change in both functions (been there to much times ;-)).

Kind regards

         Andreas.

-- 
http://fam-tille.de


Reply to: