Promotion

From Swiss PostgreSQL Users Group
Jump to: navigation, search

Here we plan to include Material that anybody can use for promoting PostgreSQL and SwissPUG.

20 Years PostgreSQL: A mail signature add-on

This ASCII Art was created on 2016-05-16 by Charles Clavadetscher and proposed on the PostgreSQL General mailing list, where some users contributed with improvements and ideas. Thanks to David Bennett, Tom Lane, Andreas Kretschmer, Michael Paquier, Melvin Davidson and Peter J. Holzer for their valuable contributions.

+------------------------+
|   ____  ______  ___    |
|  /    )/      \/   \   |
| (     / __    _\    )  |
|  \    (/ o)  ( o)   )  |
|   \_  (_  )   \ ) _/   |
|     \  /\_/    \)/     |
|      \/ <//|  |\\>     |
|           _|  |        |
|           \|_/         |
|                        |
|  PostgreSQL 1996-2016  |
|  20 years of success   |
+------------------------+

Obviously the elephant itself can be reused for other events or for general purpose

  ____  ______  ___
 /    )/      \/   \
(     / __    _\    )
 \    (/ o)  ( o)   )
  \_  (_  )   \ ) _/
    \  /\_/    \)/
     \/ <//|  |\\>
          _|  | 
          \|_/

Melvin Davidson submitted a SQL version:

CREATE TABLE elephant
(row_num integer NOT NULL,
 row_dat varchar(30) NOT NULL,
 CONSTRAINT elephant_pk PRIMARY KEY (row_num)
);

INSERT INTO elephant
(row_num, row_dat)
VALUES
( 1,'+------------------------+'),
( 2,'|   ____  ______  ___    |'),
( 3,'|  /    )/      \/   \   |'),
( 4,'| (     / __    _\    )  |'),
( 5,'|  \    (/ o)  ( o)   )  |'),
( 6,'|   \_  (_  )   \ ) _/   |'),
( 7,'|     \  /\_/    \)/     |'),
( 8,'|      \/ <//|  |\\>     |'),
( 9,'|           _|  |        |'),
(10,'|           \|_/         |'),
(11,'|                        |'),
(12,'|  PostgreSQL 1996-2016  |'),
(13,'|  20 Years of success   |'),
(14,'+------------------------+');

SELECT row_dat FROM elephant ORDER BY row_num;

Logo display as function

You can now download the code of a function that allows you to select the logo with an optional frame and an optional text. The function allows you to customize the output to some degree:

  • p_frame BOOLEAN DEFAULT false: values true or false. Display with or without a frame.
  • p_text TEXT[] DEFAULT NULL: Free text as array of text. Each element of the array is a line of text. Maximum of 8 lines. What is above is ignored.
  • p_position TEXT DEFAULT 'bottom': position of the text in relation to the pic. bottom or right.
  • p_align TEXT DEFAULT 'center': Alignment of pic AND text, when p_position is bottom, only of the text otherwise. Values: left, center, right.
  • p_valign TEXT DEFAULT 'center': Vertical alignement of the text. Only applies if p_position is right. Values: top, center, bottom.

You find the code on this link.

And here some output samples:

No arguments (all defaults):

select pg_logo();
        pg_logo
-----------------------
   ____  ______  ___
  /    )/      \/   \
 (     / __    _\    )
  \    (/ o)  ( o)   )
   \_  (_  )   \ ) _/
     \  /\_/    \)/
      \/ <//|  |\\>
           _|  |
           \|_/
(9 rows)

Add frame:

select pg_logo(true);
          pg_logo
---------------------------
 +-----------------------+
 |   ____  ______  ___   |
 |  /    )/      \/   \  |
 | (     / __    _\    ) |
 |  \    (/ o)  ( o)   ) |
 |   \_  (_  )   \ ) _/  |
 |     \  /\_/    \)/    |
 |      \/ <//|  |\\>    |
 |           _|  |       |
 |           \|_/        |
 |                       |
 +-----------------------+
(12 rows)

Add text using default positioning and alignments:

select pg_logo(true,ARRAY['Swiss PGDay 2016','24.06.2016 - HSR Rapperswil','Switzerland','http://www.pgday.ch']);
              pg_logo
 ---------------------------------
  +-----------------------------+
  |      ____  ______  ___      |
  |     /    )/      \/   \     |
  |    (     / __    _\    )    |
  |     \    (/ o)  ( o)   )    |
  |      \_  (_  )   \ ) _/     |
  |        \  /\_/    \)/       |
  |         \/ <//|  |\\>       |
  |              _|  |          |
  |              \|_/           |
  |                             |
  |      Swiss PGDay 2016       |
  | 24.06.2016 - HSR Rapperswil |
  |         Switzerland         |
  |     http://www.pgday.ch     |
  |                             |
  +-----------------------------+
 (17 rows)
 

Position text on the right hand side of the pic:

select pg_logo(true,ARRAY['Swiss PGDay 2016','24.06.2016 - HSR Rapperswil','Switzerland','http://www.pgday.ch'],'right');
                         pg_logo
 -------------------------------------------------------
  +---------------------------------------------------+
  |   ____  ______  ___                               |
  |  /    )/      \/   \                              |
  | (     / __    _\    )      Swiss PGDay 2016       |
  |  \    (/ o)  ( o)   ) 24.06.2016 - HSR Rapperswil |
  |   \_  (_  )   \ ) _/          Switzerland         |
  |     \  /\_/    \)/        http://www.pgday.ch     |
  |      \/ <//|  |\\>                                |
  |           _|  |                                   |
  |           \|_/                                    |
  |                                                   |
  +---------------------------------------------------+
 (12 rows)