Questions tagged as 'postgresql'

1
answer

UTF-8 Does not accept special characters PostgreSQL-SQL

Good morning I have created a database to store all the countries and cities and I am trying to load the data but even though my database is created with a utf-8 file like my tables. At the time of importing I also select UTF-8 but it gives me e...
asked by 15.11.2018 / 14:28
1
answer

How to model the following entities in a relational database?

I have to create tables with the following 3 entities in a DB: User(id,nombre), Client(id,nombre) y Atributo(id,Nombre,Valor) . The entities are related as follows: User can have many clients (one to many) Client can have only one...
asked by 06.11.2018 / 23:34
1
answer

PostgreSQL, stored procedure to update a table

I am creating a stored procedure to update the data userid of the table clients based on the id of the client cid ; but so far I have not succeeded: the function does not update the userid of the client. CREATE O...
asked by 04.11.2018 / 18:22
2
answers

Grails does not concern sequencia

in my database I have the following: id bigint NOT NULL DEFAULT nextval('seq_telefonosnormalizados'::regclass), While in grails I have the following: static mapping = { id column:"id", sqlType:"long", generator:'sequence', params:...
asked by 19.10.2018 / 19:58
1
answer

PostgreSQL - regexp_replace on SELECT

I am working with PostgreSQL and I can not perform a replacement query with REGEXP_REPLACE . What I need is for the column to go from what it looks like on the left side to what it appears on the right side: ------------- ------...
asked by 10.10.2018 / 14:25
1
answer

Help with a query in Postgres that I want to move to SQL SERVER

Good morning friends, I have the following query in postgres. select distinct on (c.cod_socio) tbl.*, h.cod_oficina, h.cod_transaccion, h.num_transaccion, h.num_sec, h.fec_movimiento from sgf_det_mov_his h inner join sgf_cuenta c on c.co...
asked by 26.09.2018 / 17:37
2
answers

How to move from the Postgres user to another user in the PSQL shell?

I'm logged in by a console in a Postgresql database with the postgres user. I have another user in which I want to stop, but I can not find what command to execute by console to do this. How to move from one user to the other. Logged as posgres...
asked by 30.09.2018 / 01:38
1
answer

Hide fields depending on the value in a list

I'm working laravel 5.5 I have this list on my form, The values shown are PHYSICAL and VIRTUAL: {!! Form::mySelect('id_uso', 'Uso', App\Usos::pluck('nombre', 'id')->toArray(), null, ['class'=>'chosen']) !!} and I would like if the...
asked by 15.08.2018 / 19:05
2
answers

Drop-down list with required value Laravel 5.5

I'm working on laravel 5.5 I have these lists: {!! Form::mySelect('id_uso', 'Uso', [0 => 'Escoge una opción'] + App\Usos::pluck('nombre', 'id')->toArray(), null,...
asked by 16.08.2018 / 19:00
2
answers

Why does it tell me that insert has more expressions than destination columns?

I hope you can help me I'm new to this ... CREATE DATABASE mundial WITH OWNER = postgres ENCODING = 'UTF8' LC_COLLATE = 'Spanish_Spain.1252' LC_CTYPE = 'Spanish_Spain.1252' TABLESPACE = pg_default CONNECTION LIMIT...
asked by 08.08.2018 / 17:26