Questions tagged as 'postgresql'

2
answers

How to mount a SELECT with nonexistent numeric column ordered

I want to do a SELECT with some columns already in the database and add a ordered numeric column starting at 1 for each row (I do not want the ID). I'm using PostgreSQL 8.4. Example: SELECT descricao_produto, preco, coluna...
asked by 28.01.2016 / 21:17
2
answers

Generation Strategy Id Hibernate in PostgreSQL

I have a system in JEE7 with Hibernate and PostgreSQL database, the tables are with auto Id generation by Hibernate: @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; What happens is that Hibernate generates a unique index...
asked by 18.05.2016 / 06:00
1
answer

Java - SQL Error Updating All Users

Good morning, I have the following problem my updateUsuario SQL is updating all how do I just update the User that you have accessed? public class Acessar { public static Connection con = dao.ConectarDB.getConexao(); public static String...
asked by 02.12.2015 / 11:43
2
answers

Multiply the number of elements from two different tables

I have two tables: pessoas and carros . I would like to take the number of elements of both tables, and multiply them.     
asked by 12.08.2016 / 19:03
2
answers

Validation numeric (12,2) Postgres

I have the following question, I have a field in the Postgresql database of type numeric (12,2) when sending a value of a form I did not find a way to validate the value in PHP to insert this value in the database. > Error generated: Numeric v...
asked by 15.10.2015 / 21:17
1
answer

Could you add a UNIQUE field that accepts nulls?

Can I create a field that accepts nulls and say that it is unique? This my table, the CRM indicates that it is a doctor and not a normal person, it has to be unique, but it has to allow for nulls. This field is also a foreign key in another t...
asked by 05.03.2015 / 19:40
2
answers

How to insert sequence in non-self-incrementing field

I need to insert records into one table with data from another by continuing the sequence of a column that already exists in it, but the column I want to continue the sequence is not self-incrementing and the table does not have a primary key....
asked by 21.11.2017 / 14:12
3
answers

Save date in Brazilian format in Postgresql

I have a PostgreSQL database on the Windows Azure server that is set to the Brazilian standard. If I do a SQL and execute directly on PgAdminIII from the server and execute, the date is saved in the Brazilian format. But if I have my C # c...
asked by 10.05.2017 / 02:46
2
answers

Separate one column from the bank in two and pick up the values of the already created users

I have a user table in the database that has a NAME column, but it will be necessary to separate NAME and SURNAME. My question is: will users already created in the database have to be edited one by one? Or does it have some command that I can b...
asked by 08.03.2018 / 15:40
1
answer

NullReferenceException when calling function

I'm creating some unit tests for a class library that does manipulations in a database. The method being tested is this: public object ExecuteNoQueryOperation ( string spOrSqlInstructions, CommandType commandType = CommandType.StoredProcedu...
asked by 04.06.2016 / 20:01