Arquivo da tag: PostgreSQL

gem pg not installing

 sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
 sudo apt-get update
 sudo apt-get install postgresql-common
 sudo apt-get install postgresql-9.5 libpq-dev

How do you use variables in a simple PostgreSQL script?

DO $$
DECLARE  
   a INTEGER := 10;  
   b INTEGER := 20;  
   c INTEGER;  
BEGIN  
   c := a + b;
    RAISE NOTICE'Value of c: %', c;
END $$;

https://stackoverflow.com/questions/766657/how-do-you-use-variables-in-a-simple-postgresql-script