Questions tagged as 'postgresql'

1
answer

Selecting SQL Related Records

I have two tables, one that calls grupo where the groups created for access to an application are stored. For example, if you have the CADASTRO_ADMIN group, you will have full permission; now, if you have the group CADASTRO_USR...
asked by 21.07.2017 / 01:03
1
answer

Function in Postgresql with update returns error when updating 2 columns

I'm a beginner in postgresql and I have a question I can not solve. I did a simple function in the database that updates a record: CREATE OR REPLACE FUNCTION public.teste( p_rec_id_transacao character varying, p_rec_valorA numeric) RET...
asked by 15.07.2017 / 03:00
1
answer

How do I not display null values and display values on a line in this condition?

I have 3 tables, one is called custom_values with a VALUE field of type TEXT where it receives several types of information, so I identify each value by the relationship with another table called custom_fields where I use two...
asked by 14.07.2017 / 16:25
1
answer

How to give permissions to user groups in PostgreSQL?

*Allregistereduserswhoaremembersof"SITE ACCESS" will have the same permissions. I created a Group Roles in PostgreSQL called "ACCESS SITE" to put all users (Login Roles) of sites and systems that will have permissions to search, insert, upda...
asked by 07.07.2017 / 18:22
1
answer

subquery with 3 different tables using ilike in postgres

Personal I have a question. How do I search for a particular text using ilike to know if this text exists in 3 related tables. I tried to exist but did not give CREATE TABLE metodo ( id SERIAL NOT NULL, descricao CHARACTER VARYING NOT...
asked by 19.07.2017 / 22:36
1
answer

Sequelize Migrate - Error: TypeError: defineCall is not a function

Hi, I'm doing a simple championship API, I used Sequelize as ORM for my database. I created the Arbitrator table that had only the NAME field and did not have the CPF field in the table. I had to include the CPF field in the Arbitra...
asked by 20.05.2017 / 18:24
2
answers

Give a select to return the unique values

I have multiple values repeated, the value can have status (different or different) or I can have two values with different / differentiated statuses, and I need to make a comparison between them (in this case I use a key). unique that are diffe...
asked by 12.05.2017 / 21:16
1
answer

If exists update else insert in table with foreign key postgres

I need to make an insert in a table with a foreign key, so if that record does not exist in the other table I need to do an insert, can I do this using if exists? Any solution?     
asked by 08.05.2017 / 21:57
1
answer

Conversion to date type PostgreSQL

Hello, I'm working with a database that has the date information stored in a varchar (50) as in the following example: "2012 December 2 18:37". I need to do time-based searches. However, I'm not succeeding at converting this char to date t...
asked by 24.05.2017 / 22:00
1
answer

Json.parse does not convert to array

Hello, I am a full-fledged amateur in php and javascript and after a month of fighting with two languages that I had never stirred I got here. I'm trying to pass a JSON from a request back to array in my javascript, but when I use parse and p...
asked by 26.04.2017 / 14:21