Tuesday, January 5, 2016

PostgreSQL / Postgres / Postgre


lg@lgstage11:~$ psql -U user -p 5432 mydb

mydb=> \dt

 Liste des relations
 Schéma |       Nom       | Type  | Propriétaire
--------+-----------------+-------+--------------
 public | shop_c           | table | user
 public | shop_ean       | table | user
(2 lignes)

mydb=> \x      -> formatting

select * from shop_e limit 10;

service postgresql stop
service postgresql start

psql -U user --password
if this complains that the user doesn't have a database, you can do it another way:
postgre@machine:  createuser search
postgre@machine:  createdb search

\copy (select lt.image.lt_kimage_id from lt.image LIMIT 100000) To '/tmp/test.csv';

DELETE FROM image WHERE image_id IN (select image.image_id from image INNER JOIN keyword ON image_id = keyword.image_id WHERE keyword.keyword LIKE '%_dead' ORDER BY image_id LIMIT 200000);

-- if "psql" doesn't work, do this first:
    su - postgres
 https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546
.
.

    No comments: