Questions tagged as 'postgresql'

1
answer

Validation login with PHP / Postgresql PDO

I am working with a login form in html / PDO PHP. As my PDO knowledge is almost zero I have been advancing in what the logic indicates and with stackoverflow. I already made my connection and data capture and validated the information (I repeat...
asked by 04.05.2018 / 19:12
1
answer

sql query returns incorrect result

Hi guys I have the following query, I'm working in PostgreSQL, and my base is a survey applied to people in certain areas, basically you need to make an analysis that if you have some kind of animal this family, put the number one (as if it were...
asked by 07.03.2018 / 16:59
1
answer

the sql statement in postgres, is the prefix "public" necessary?

I am working with PHP and PDO connecting to a postgresql database, I have a doubt, since something that I do not expect is happening. $pdo = new PDO('pgsql:dbname=db_pdo_postgresql; host=localhost;', 'juan_postgres...
asked by 18.02.2018 / 14:00
1
answer

psql - function with case

Someone can tell me that there is bad in this function, whenever I put a result it goes to the else and I do not know where to attack Thank you     
asked by 19.03.2018 / 11:23
1
answer

Query SQl with inner join to filter data based on the user that enters the system

Teng a Database with the following scheme: The user belongs to an establishment, the establishment belongs to a municipality, the department has many municipalities and the municipality has many cantons, so I want an SQL query that returns...
asked by 26.02.2018 / 15:55
1
answer

How to get a single record of a JOIN between 2 tables?

I happen to have 2 tables. One is the "main" table and another table where data is saved according to what is recorded in table 1. Table 1 will only have one record, while table 2 can have 2 or more records that depend on the record that was mad...
asked by 26.02.2018 / 01:55
2
answers

postgresql error with django

error: manage.py makemigrations Traceback (most recent call last): File "C:\Users\pcort\Documents\Programacion\programacionWeb\postgresql_django\venv\lib\site-packages\django\db\backends\base\base.py", line 216, in ensure_connection self....
asked by 11.01.2018 / 22:36
3
answers

Count repeated cases in SQL

I do not have much experience in SQL and I'm making a mess to solve something that almost certainly is not very complex. I have a table that has a column with an alphanumeric code: columnA {xa1, xa2, xa3, xa3, xa3, xa4, xa4, xa5, xa6, xa6,...
asked by 31.12.2017 / 12:08
2
answers

add columns after another in postgresql

I would like to know if there is a way to add columns later after a certain column in postgre, as in mysql that aría in this way alter table personal add capital int not null after nom; I would like to know if there is any way in postgresql...
asked by 06.12.2017 / 23:10
1
answer

Problems with a query

I have some problems with a Query that I can not get out, the structure of the tables is as follows: child child_id ----->CLAVE PRIMARIA child_name birth_date gender address city letter letter_id --->Clave p...
asked by 29.10.2017 / 21:22