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

Re: [PATCH] Add generate_bibtex.py: Make use of a separate script for generation of debian.{bib,tex} files



Hi,

On 5/15/15, Andreas Tille <andreas@an3as.eu> wrote:
> Hi Akshita,
>
> However, there seems to be some other issue:
>
> (master) $ LC_ALL=C psql udd < sql/upgrade_bibtex.sql
> FEHLER:  Syntaxfehler bei „IF“
> LINE 7:   IF sources IS NULL THEN
>           ^

I am not sure but it may be because of the missing:
 BEGIN
   IF ...
   ....
   END IF;
 END;

If you have time, can you please check after modifying the function as below:

CREATE OR REPLACE FUNCTION bibentry (bibref text, sources text DEFAULT NULL)
RETURNS TABLE(source text, rank text, package text) LANGUAGE SQL
AS $$
BEGIN
  IF sources IS NULL THEN
  BEGIN
    SELECT DISTINCT source, rank, package FROM bibref p;
  ELSE
    SELECT DISTINCT source, rank, package FROM bibref p INNER JOIN
sources s ON s.source = p.source;
  END IF;
END;
$$;

Or will it be better if I send another patch with these modifications
? I am not sure whether this is exactly the issue, but we can check
this once.

> FEHLER:  Relation „bibtable“ existiert nicht
> LINE 63: ... FROM (SELECT DISTINCT source, package, rank FROM bibtable) ...
>                                                               ^
>
> Moreover, I think you wanted do write source to verify the function
> parameter, right?
>

Yes. if sources (which is a function parameter) is NULL then
references from "bibref" table are taken else there is a join with
"sources" table. This is what I wanted to check.

> Sorry, no time to track this down completely.

Whenever you get some time, can you please check after the minor
modification suggested above and let me know ?

Thanks alot,
Akshita


Reply to: