Tuesday, September 11, 2012

liquid feedback readme from tar file


The tar file has instructions for debian and i am going to use it on ubuntu





Setup the database:
$ createdb liquid_feedback
$ psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback


@ubuntu:~$ createdb liquid_feedback
createdb: could not connect to database postgres: FATAL:  role "ie" does not exist


http://www.bartbusschots.ie/blog/?p=627 osx related help file
http://osdir.com/ml/qgis-user-gis/2012-06/msg00123.html


e@ubuntu:~$ su - postgres
Password:


works!! (because i had set up a password in earlier posts )



postgres@ubuntu:~$ createdb liquid_feedback
createdb: database creation failed: ERROR:  database "liquid_feedback" already exists


postgres@ubuntu:~$ createlang plpgsql liquid_feedback
createlang: language "plpgsql" is already installed in database "liquid_feedback"


postgres@ubuntu:~$ psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
core.sql: No such file or directory



ie@ubuntu:~/Downloads/liquid_feedback_core-v2.0.11$ cp core.sql lf_update /opt/liquid_feedback_core/

cp: cannot create regular file `/opt/liquid_feedback_core/core.sql': Permission denied

cp: cannot stat `lf_update': No such file or directory

e@ubuntu:~/Downloads/liquid_feedback_core-v2.0.11$ sudo cp core.sql lf_update /opt/liquid_feedback_core/
[sudo] password for ie: 
cp: cannot stat `lf_update': No such file or directory

The problem here is there is NO file called 

lf_update in the tarball there is a file called 


lf_update.c !!


http://bathroom.baclayon.com/postgres/connect.php good article on postgres commands



postgres@ubuntu:~$ createuser
Enter name of role to add: www-data
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
createuser: creation of new role failed: ERROR:  role "www-data" already exists

postgres@ubuntu:~$ deleteuser
deleteuser: command not found
postgres@ubuntu:~$ drop user www-data
No command 'drop' found, did you mean:
 Command 'dtop' from package 'diod' (universe)
drop: command not found

postgres@ubuntu:~$ DROP USER www-data
DROP: command not found





createdb: command not found
then PostgreSQL was not installed properly. Either it was not installed at all or your shell's search path was not set to include it. Try calling the command with an absolute path instead:
http://www.postgresql.org/docs/devel/static/tutorial-createdb.html



postgres@ubuntu:~$ dropuser
Enter name of role to drop: www-data



postgres@ubuntu:~$ createuser
Enter name of role to add: www-data
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n



postgres@ubuntu:~$ su www-data
Password:
su: Authentication failure
postgres@ubuntu:~$

so i want to add a password 

ALTER USER Postgres WITH PASSWORD '';
http://archives.postgresql.org/pgsql-novice/2007-02/msg00062.php
http://www.postgresql.org/docs/8.0/static/sql-alteruser.html
http://www.postgresql.org/docs/devel/static/app-createuser.html


postgres@ubuntu:~$ alter user www-data with password rrrr
No command 'alter' found, did you mean:
 Command 'qalter' from package 'torque-client' (universe)
 Command 'qalter' from package 'gridengine-client' (universe)
 Command 'qalter' from package 'torque-client-x11' (universe)
alter: command not found
postgres@ubuntu:~$ alteruser www-data with password rrrrr
alteruser: command not found
postgres@ubuntu:~$ ALTER USER www-data WITH PASSWORD rrrrr
ALTER: command not found




postgres@ubuntu:~$ ALTER ROLE www-data WITH PASSWORD NULL;
ALTER: command not found





postgres@ubuntu:~$ createdb mydb
postgres@ubuntu:~$ dropdb mydb
postgres@ubuntu:~$ psql liquid_feedback
psql (9.1.5)
Type "help" for help.

liquid_feedback=# select * from system_setting;
ERROR:  relation "system_setting" does not exist
LINE 1: select * from system_setting;
                      ^
@ubuntu:/opt/liquid_feedback_core$ su www-data
Password: 
su: Authentication failure








psql (9.1.5)
Type "help" for help.

mydb=>
The last line could also be:

mydb=#
That would mean you are a database superuser,


To get out of psql, type:

mydb=> \q

mydb=> SELECT version();



http://www.postgresql.org/docs/9.1/static/tutorial-accessdb.html


@ubuntu:/$ sudo -u postgres psql
psql (9.1.5)
Type "help" for help.

postgres=# alter user www-data with encrypted password 'password';
ERROR:  syntax error at or near "-"
LINE 1: alter user www-data with encrypted password 'password';
                      ^
postgres=# alter user www-data password 'password';
ERROR:  syntax error at or near "-"
LINE 1: alter user www-data password 'password';



postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

  \? for help with psql commands
 \password [USERNAME]   securely change the password for a user


postgres=# \password www-data
Enter new password:
Enter it again:










command to get postgresql version

psql -c "select version();" template1




 PostgreSQL 9.1.5 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit




Optionally insert demo data:
$ psql -v ON_ERROR_STOP=1 -f demo.sql liquid_feedback

Compile lf_update binary:
$ make

Ensure that "lf_update dbname=liquid_feedback" is called regularly!

It is required that lf_update is executed regulary (i.e. every
5 minutes via cron) to update cached supporter counts, to change
the state of issues when neccessary, and to calculate the result
of votings. If you wish, copy the created lf_update file to
/usr/local/bin or a similar directory.

On successful run, lf_update will not produce any output
and exit with code 0.

NOTE: When writing to the database, some INSERTs must be executed
      within the same transaction, e.g. issues can't exist without
      an initiative and vice versa.

To create an export file, which is containing all but private data,
you may use the lf_export shell-script:
$ lf_export liquid_feedback export.sql.gz

To uninstall the software, delete the lf_update binary
and drop the database by entering the following command:
$ dropdb liquid_feedback

Updating is done using the update scripts in the update/ directory.
After updating it is recommended to recreate the schema as follows
(assuming the database superuser is named "postgres"):
$ pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql
$ dropdb DATABASE_NAME
$ createdb DATABASE_NAME
$ psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME
$ su postgres  # (execute following command as database superuser)
$ psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME
$ exit         # leave "su" command
$ rm tmp.sql

No comments:

Post a Comment