pygments-main / tests / examplefiles / postgresql_test.txt

CREATE OR REPLACE FUNCTION something() RETURNS int4 AS
$x$
BEGIN
    RETURN 42;
END
$x$
LANGUAGE 'plpgsql';

CREATE FUNCTION pymax (a integer, b integer)
  RETURNS integer
AS $$
  if a > b:
    return a
  return b
$$ language plpythonu;

CREATE FUNCTION nested_lexers (a integer, b integer)
$function$
BEGIN
    SELECT ($1 ~ $q$[\t\r\n\v\\]$q$);
END;
$function$
LANGUAGE sql;

CREATE OR REPLACE FUNCTION measurement_insert_trigger()
RETURNS TRIGGER AS $$
BEGIN
    <<test>>
    INSERT INTO measurement_y2008m01 VALUES (NEW.*);
    RETURN NULL;
END;
$$
LANGUAGE plpgsql;

-- As returned by pg_dump
CREATE FUNCTION test_function() RETURNS integer
    LANGUAGE plpgsql STABLE STRICT
    AS $$
begin
    return 42;
end
$$;

-- Unicode names and strings
SELECT U&'\0441\043B\043E\043D'
FROM U&"\0441\043B\043E\043D";
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.