Questions tagged as 'postgresql'

4
answers

Workbench for PostgreSQL

Does anyone know of any Workbench for PostgreSQL? I need it, because I do not want to move postgres through the command line.     
asked by 29.02.2016 / 15:27
1
answer

Sql - Select first and last record

I have the following tables: CREATE TABLE tb_lote ( id_lote integer NOT NULL DEFAULT nextval('tb_lote_seq'::regclass), ds_lote character varying(255), CONSTRAINT pktb_lote PRIMARY KEY (id_lote) ); CREATE TABLE tb_lote_ticket ( id_lote...
asked by 02.10.2015 / 17:09
2
answers

Use timestamp with or without timezone in postgresql?

Use timestamp with or without timezone in Postgres? The Web application will be used in different countries, so I will have to deal with different time zones. The system has data entry of several different objects that have the day and time t...
asked by 24.08.2017 / 20:54
2
answers

Is it redundant to use LIMIT in a QUERY whose ID is a primary key?

My question is if using LIMIT will there be some performance gain in QUERY . Example: SELECT descricao FROM produto WHERE id = 9999 LIMIT 1 Has better performance than? SELECT descricao FROM produto WHERE id = 9999...
asked by 17.05.2015 / 01:57
3
answers

How to sort records in the query according to another sort?

I have a table with the following columns: id - manager_id - value - source - source_id By registering an "Account to Pay", I enter in this table the company's management breakdowns. Assuming that it would have to pay a certain vendor the...
asked by 10.12.2015 / 20:05
2
answers

Function equivalent to "DISTINCT ON" in Oracle DB?

In Postgres, you can have distinct apply to just 1 field of the select using DISTINC ON , how can I reproduce this function in an Oracle database? Here is an example query: SELECT DISTINCT ON (CITY) CITY, STATE, ZIPCODE, ROW_ID FROM d...
asked by 23.12.2014 / 20:19
1
answer

Problem with .Include () in the Entity Framework (Postgres)

I've been having a problem with EntityFramework, it's the following: When I use the ORM (.Include) string to join tables to foreign keys, it automatically renames the keys in the string automatically generated by it and ends up not finding it...
asked by 19.10.2015 / 17:11
2
answers

What does bank return INSERT 0 1 mean?

When I execute commands in the bank I have returns to and execution of the same ones. Doubt What does 0 mean INSERT 0 1 ? Example CREATE TABLE test( id SERIAL, name VARCHAR(50), PRIMARY KEY (id) ); input:...
asked by 28.06.2017 / 15:53
2
answers

Rescuing the last insert in the database with PDO lastInsertId

I'm trying to redeem the last id on the bank with lastInsertId() of the PDO, but nothing appears. OBS: I'm using Postgre. <?php try { $dbh = new PDO('pgsql:host=localhost;port=5432;dbname=bancocjweb1', 'postgres', '1...
asked by 02.09.2014 / 07:01
2
answers

Comparison with Postgresql database using C #

I created a Login application, I made the connection to the database, I get the user and password registered in my bank. But what I want is, if the user tries more than three times to get in and has something wrong, block the textbox and butt...
asked by 09.07.2015 / 21:07