Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
it works Sir Adrian. Thanks!! >From psycopg2 documentation "*Never* use % or + to merge values into queries :" but in this scenario, I can use it, right? On Wed, May 9, 2018 at 12:21 PM, Adrian Klaver wrote: > On 05/08/2018 07:17 PM, tango

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread Adrian Klaver
On 05/08/2018 07:17 PM, tango ward wrote: Hi, Sorry for asking question again. I am trying to concatenate the value of column firstname and lastname from source DB to name column of destination DB. My code so far: cur_t.execute("""     SELECT firstname, lastname   

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
thanks for the ideas Sir. I haven't touched DB this deep before. Basically I need to migrate the data of a DB into a new complete system made in Django. The system architecture created in Django has big difference in terms of tables and columns than the data from source DB. Source DB doesn't have

New install of 9.5.12 missing default PostgreSQL DB

2018-05-08 Thread chandru.ar...@yahoo.com
I installed PostgreSQL using PostgreSQL-9.5.12-1-win64-bigsql on a Windows 10 system.  I installed as a local admin.  The installation completed fine, although it failed earlier when I tried to install it as non-admin of the laptop. When I launch pgAdmin, I don't see the default instance of the

.ready files being created on secondaries

2018-05-08 Thread Christophe Pettus
We've encountered another system that has a situation very much like the one described here: https://www.postgresql.org/message-id/20140904175036.310c6466%40erg In particular, a secondary is restoring each WAL file using restore_command, creating a .ready file for it, and then never cle

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread David G. Johnston
On Tue, May 8, 2018 at 7:44 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, May 8, 2018 at 7:17 PM, tango ward wrote: > >> I am trying to concatenate the value of column firstname and lastname >> from source DB to name column of destination DB. >> >> for row in cur_t: >>

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread David G. Johnston
On Tue, May 8, 2018 at 7:17 PM, tango ward wrote: > I am trying to concatenate the value of column firstname and lastname from > source DB to name column of destination DB. > > (SELECT CONCAT(first_name, ',', last_name) AS > name FROM lib_author LIMIT 1) >

Concatenate 2 Column Values For One Column

2018-05-08 Thread tango ward
Hi, Sorry for asking question again. I am trying to concatenate the value of column firstname and lastname from source DB to name column of destination DB. My code so far: cur_t.execute(""" SELECT firstname, lastname FROM authors; """) for row in

issues when installing postgres

2018-05-08 Thread Antonio Silva
Hello! I bought a new computer and I installed Ubuntu 18.04 and after PostgreSQL. sudo apt install postgresql postgresql-contrib pgadmin3 Nevertheless I had some issues with configuration files and decided to uninstall it completely sudo apt purge postgresql postgresql-contrib pgadmin3 When I in

Re: Error creating plpython3u extension

2018-05-08 Thread Jeff Peck
On 05/08/2018 03:28 PM, Bruce Harold wrote: Hi I have PostgreSQL 10 on Windows 10 and the EDB language pack X64 for Python 3.4 etc. I edited the *system* environment variables: PYTHONPATH = C:\edb\languagepack-10\x64\Python-3.4 Added C:\edb\LanguagePack-10\x64\Python-3.4\bin to PATH Crea

Re: Error creating plpython3u extension

2018-05-08 Thread Adrian Klaver
On 05/08/2018 01:28 PM, Bruce Harold wrote: Hi I have PostgreSQL 10 on Windows 10 and the EDB language pack X64 for Python 3.4 etc. I edited the *system* environment variables: According to this: https://www.enterprisedb.com/docs/en/10.0/Language_Pack_v10/EDB_Postgres_Language_Pack_Guide.1

Error creating plpython3u extension

2018-05-08 Thread Bruce Harold
Hi I have PostgreSQL 10 on Windows 10 and the EDB language pack X64 for Python 3.4 etc. I edited the system environment variables: PYTHONPATH = C:\edb\languagepack-10\x64\Python-3.4 Added C:\edb\LanguagePack-10\x64\Python-3.4\bin to PATH Creating the extension plpython3u errors: ERROR: could

Re: cursor empty

2018-05-08 Thread Philipp Kraus
Am 08.05.2018 um 16:18 schrieb David G. Johnston mailto:david.g.johns...@gmail.com>>: On Tue, May 8, 2018 at 6:36 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: select * from vectorize('myvec'); fetch all from myvec; Can you explain me, which part is wrong? I am going to say: p

Re: cursor empty

2018-05-08 Thread David G. Johnston
On Tue, May 8, 2018 at 6:36 AM, Adrian Klaver wrote: > >> select * from vectorize('myvec'); >> fetch all from myvec; >> >> Can you explain me, which part is wrong? >> > > I am going to say: > > perform pivottable( ... > > https://www.postgresql.org/docs/10/static/plpgsql-statements > .html#PLPGSQ

Autovacuum holding exclusive lock on table

2018-05-08 Thread Kumar, Virendra
Hi, I have as scenario where one of our developer created a table loaded huge amount of data and since then auto vacuum is not letting us do alter table for disabling it, even truncate and drop are locked. Is there anything we can do to prevent this and disable autovacuum at least. Regards, V

Re: cursor empty

2018-05-08 Thread Adrian Klaver
On 05/08/2018 05:39 AM, Philipp Kraus wrote: Hello, I have got a function with this definition: CREATE OR REPLACE FUNCTION vectorize(refcursor) RETURNS SETOF refcursor LANGUAGE 'plpgsql' COST 100 STABLE ROWS 1000 AS $BODY$ begin perform pivottable(

cursor empty

2018-05-08 Thread Philipp Kraus
Hello, I have got a function with this definition: CREATE OR REPLACE FUNCTION vectorize(refcursor) RETURNS SETOF refcursor LANGUAGE 'plpgsql' COST 100 STABLE ROWS 1000 AS $BODY$ begin perform pivottable( '_vector', 'select * from vi