Questions tagged as 'postgresql'

1
answer

Export Text field to Bytea in PostgreSQL

I could make an application to export the contents of a Text field to Bytea without problems, but as they are thousands of records I believe that if I do via SQL it will be faster. If this is possible of course. I have a table with a text...
asked by 27.06.2018 / 17:36
1
answer

How to insert this text in PostgreSQL?

I'm using a Delphi query and I need to insert the text below into a text type field {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}{\f1\froman\fcharset0 Times New Roman;}{\f2\fnil\fcharset0 Tahoma;}} {\colortbl ;\re...
asked by 27.06.2018 / 23:32
2
answers

Validate only 1 and 2 in an sql table in the relational and logical model?

Good morning, how do I validate values using relational and logical relationships, where the employee can only enter values below? 1: Disponível 2: Emprestado     
asked by 05.06.2018 / 13:09
1
answer

SpringBoot with hibernate and relationship between postgres tables in different schemas

I have the following problem: I created a database named Test and it has two schemas: schema1 and schema2. Within each schema has a table: schema1 - > table1 schema2 - > table2 It turns out that if I try to make a relationship with Spri...
asked by 20.07.2018 / 20:06
1
answer

How to set the time of a timestamp to 23:59:59 in postgresql?

I have a cell that contains only the date, in the case 2018-07-11 , I need to make a select that will bring that cell like this: 2018-07-11 23:59:59 , is it possible to do that?     
asked by 11.07.2018 / 22:32
1
answer

SQL Join multiple tables only the 1st result

I have 3 tables: **clientes** cli_cliente nome 50 A 52 B **telefones_cliente** cli_cliente tel_telefone 50 387 50 386 50 385 52 400 **telefones** tel_telefone tel_contato 3...
asked by 12.07.2018 / 15:31
1
answer

Password when executing postgresql command

Good morning, I'm trying to create a database in postgresql via terminal on windows. But he asks me for a password every time I give him the command. I tried using the postgres user password but did not accept it. Can anyone help me?  ...
asked by 03.07.2018 / 17:12
1
answer

How to shrink a large query - Postgresql [closed]

In Visual Studio, we have the possibility to shrink a large code, that is, visually decrease the size, as a way to make reading easier, for example: #region Seu código aqui... #endregion I would like to do the same in a query within my PG...
asked by 21.05.2018 / 18:24
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
1
answer

Check how many Products were sold in the year 2017

I'm having trouble doing this query using BETWEEN this is the template     
asked by 16.05.2018 / 04:22