Questions tagged as 'psql'

3
answers

psql command at the prompt. (Postgresql Bank)

Good morning, I'm trying to make a script with .bat extension to do automatic update in the bank, except that in order to do this I need to know how to enter the password of my bank through command. I'm doing the following to access my ban...
asked by 16.02.2017 / 17:13
1
answer

How to audit records by saving changes in JSON

I'm using a function to audit records in insert, update, delete events for a PostGres 9.6 table . I took the script from the Git-audit-trigger The script has been implemented and is working perfectly, but one of the results it brings m...
asked by 21.06.2018 / 16:29
1
answer

C # - Check if dates are missing in the selected date range

I have the following SQL SELECT dt_finished::date AS "DataFinalizacao", count(DISTINCT tba.id_batches) AS "Quantidade Total" FROM tb_batches AS tba INNER JOIN tb_routes tro ON (tro.fk_id_products = tba.fk_id_products AND tro.fk...
asked by 08.12.2017 / 18:19
1
answer

Get table name with Trigger / Function in Postgres

I am implementing a simple replication form of two tables or more. I have the replication table that has the name of the table to be replicated and id. To feed the replication table I have a trigger on each table that will be replicated b...
asked by 11.01.2018 / 18:27
1
answer

PGbouncer does not connect via service on windows

I installed pgbouncer as a service on windows 10 using: pgbouncer.exe --regservice <pgbouncer.ini> Placing the ini path and from the folder where the pgbouncer exe is. The service is installed normally and I can start it by the wind...
asked by 27.06.2017 / 21:45
1
answer

Script for postgres database

I created this script, to clear the table from the bank and to clear id 's. It works, but not the right way It runs and authenticates on psql . but instead of running the sql command it only opens psql . If someone has an exit alr...
asked by 13.06.2018 / 22:12
0
answers

"column does not exist" using PostgreSQL

Error: psycopg2.ProgrammingError: column "marcos" does not exist LINE 1: ...RT INTO user_table (nome, usuario, senha) VALUES ("marcos", ... ^ Code: cur.execute('INSERT INTO us...
asked by 28.11.2018 / 20:31
2
answers

Postgresql, Variables for psql functions

I'm trying to create a trigger function to remove a schema created in the database based on an idproj attribute of the geo.projects table listed below: CREATE TABLE geo.projetos ( idproj serial NOT NULL, ... , -- outros atributos...
asked by 11.01.2018 / 20:35
1
answer

Postgresql Regular Expressions

Personal speech, I need some help I'm trying to make a trigger in postgresql that checks if the format of a new data being inserted into a table is in a certain format, in this case the phone format. I need the new phone to be inserted in...
asked by 07.12.2017 / 15:47