Questions tagged as 'postgresql'

1
answer

Migrating Microsoft SQL to Postgres

I need to migrate my SQL database to Postgre-SQL, but I do not have much intimacy with the database itself. Is there any tool that can help with migration? I have backup of generated MS SQL .bak is it possible to convert it? Thankful!     
asked by 07.10.2015 / 20:43
3
answers

Viability to create 200 columns in database [closed]

I am planning software, which is a test of 200 questions where each question can only have 3 choices and select only one, and each question belongs to a class type (eg question 5 belongs to class B , are classes from A to J) and I need to save t...
asked by 28.03.2016 / 20:35
1
answer

When should I create a constraint as DEFERRED?

As far as I know, creating a constraint (such as a foreign key or a check) as DEFERRED causes it to only be validated at the end of the transaction. Why is this used? And when should it not be used?     
asked by 18.03.2015 / 13:24
1
answer

How to keep a record in the database, however, hidden to the system?

I have an application in Delphi and I need that in this application when the user deletes a record, this record continues in the database, but is hidden in the system.     
asked by 07.10.2017 / 16:26
4
answers

sql - SELECT for recent data only

   I think my title is not a question. The application I develop inserts data pertaining to the last backup into a table once a month. This table contains the backup instance code, the given insert and the number of bytes. The problem is...
asked by 05.02.2015 / 15:55
2
answers

Dapper requires writing SQL code, why?

I'm looking at the following link using Dapper: Getting Started With PostgreSQL Using Dapper In .NET Core and my question is, when I do it through Java I do not need to write the SQL code as this example here: //1. Insert using (var conn =...
asked by 17.08.2018 / 22:06
1
answer

Joining multiple SQL queries into a single query

I have a 'mission' in my work, where I need to join some queries in a single query. But I have no idea how I can do this so that everything I need is returned with just one query to the bank. Is there any way to merge queries? UNION does not sol...
asked by 03.07.2014 / 15:10
1
answer

Is there any way to compress data stored in byte []?

I get a byte[] that is an image, and saved in the database (Postgres) in a column byte[] todo. How can I compress? Leave lower this byte[] ?     
asked by 15.04.2014 / 19:10
1
answer

Postgresql Autoincrement skips 1 value when the insert is made by a function

I have the following function in Postgresql : CREATE OR REPLACE FUNCTION ve.geraHistorico() RETURNS VOID AS $$ DECLARE i INTEGER := 1; id INTEGER; dataCad TEXT; dataFec TEXT; qtd INTEGER := (SELECT COUNT(id) FROM ve....
asked by 04.07.2018 / 19:42
1
answer

How to make a query in sql that returns the data of a table when the data is empty? [duplicate]

Well, I created a table called installments, which when the customer pays it is entered 'PAYMENT' in the column situation, and when not paid it remains blank. I wanted to get the information from this column to know when the account was not pa...
asked by 29.10.2017 / 16:09