Questions tagged as 'postgresql'

1
answer

Simple Data Replication in PostgreSQL

I created two tables with a primary key and needed to replicate them, ie put them in another database but all on the same machine. How should I do this? The tables created are these: CREATE TABLE cities1 ( city varchar(80) pri...
asked by 07.09.2014 / 22:31
1
answer

Translation of MySQL code for PostgreSQL [closed]

I need to convert a MySQL page into PostgreSQL commands, but I have already reviewed the internet looking for similar commands and PostgreSQL syntax, and I did not succeed. Some commands do not exist for PostgreSQL and are declared together w...
asked by 17.11.2015 / 17:27
1
answer

How to maintain multiple connections to postgresql in Node.js?

I'm using Node.js in a task where I need to migrate data between two PostgreSQL databases. The idea is more or less as follows: Connect to Bank A. Connect to Bank B. Return all records of A. Insert all A's Registers not yet present in...
asked by 27.10.2015 / 14:05
3
answers

Difference in months of date in postgresql

I need to take the difference of two dates, for example 03/16/2013 to 07/16/2014. If I do select extract('Month' from age(data1, data2)) What will return is a result 4 , since it informs that the difference enters the date is 1 year o...
asked by 15.08.2014 / 01:44
2
answers

How to set the password for PostgreSQL administration?

I installed PostgreSQL on my Ubuntu using "apt-get". I've been using "sudo" to perform operations (actually following a tutorial), but now I want to administer the DBMS with a client that asks me for the admin password "postgres". How do I se...
asked by 14.12.2013 / 14:36
2
answers

EF6 + PostGresql - 22021: invalid byte sequence for encoding \ "UTF8 \": 0xc9 0x52

I am trying to get data from a PostGreSql database with SQL_ASCII Enconding, however in some records I get the error message 22021: invalid byte sequence for encoding \ "UTF8 \": 0xc9 0x52 " / p> I have tried to set the Enconding in the conne...
asked by 04.06.2016 / 22:10
1
answer

How does PostgreSQL inheritance work?

How does inheritance work in PostgreSQL? Is it a good practice within relational database frameworks? How do you use it?     
asked by 27.03.2017 / 13:58
2
answers

Change boolean column to integer

I'm using a database that has a field called: status: boolean , however I want to store the values of the Radio Button (0,1,2) so I need to change to integer . I'vetried:ALTERTABLEOSALTERCOLUMNSTATUSTYPEBOOLEANUSING(trim(STATUS):...
asked by 24.10.2017 / 17:46
1
answer

How to create a sequence in varchar in the Postgres database?

I have the following table in the Postgres database: CREATE TABLE customer ( userid character varying(30) NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30) NOT NULL, balance double precision NOT NULL,...
asked by 21.09.2015 / 20:56
1
answer

How to handle multiple quotes in R?

My problem is to use the quotation marks in a query within an R function. I have to call a list of select * from probes."probes_90_2018-05" For this I do: coelho<-dbConnect("PostgreSQL", fnord) dbGetQuery(coelho,"select * from probe...
asked by 11.07.2018 / 23:17