managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Krishnakant Mane
Hello all, I have been using postgresql for an enterprise quality account's automation and inventory management software called GNUKhata Our team is planning to add backup and restore function in the software. But we don't want to dump the entire database and then restore t

pgq is one of the most underrated pg related stuff

2019-09-25 Thread Миша Тюрин
Ok! How are you doing on (with)without pgq? // another underrated was multicorn. Is it still alive? Thank you! And sorry for provocative way. — Misha

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Rob Sargent
> On Sep 25, 2019, at 1:15 AM, Krishnakant Mane wrote: > > Hello all, > > I have been using postgresql for an enterprise quality account's automation > and inventory management software called GNUKhata > > Our team is planning to add backup and restore function in the s

Receivgin error while altering the table column datatype

2019-09-25 Thread Raghavendra Rao J S V
Hi All, I am receiving below error while altering the table column datatype. *Reason:SQL Error [0A000]: ERROR: cannot alter type of a column used in a trigger definition Detail: trigger extensiontrigger on table tele depends on column "phonenumber"* Do I need to drop the trigger and alter the

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Krishnakant Mane
On 25/09/19 4:32 PM, Rob Sargent wrote: > > > On Sep 25, 2019, at 1:15 AM, Krishnakant Mane > wrote: > >> Hello all, >> >> I have been using postgresql for an enterprise quality account's >> automation and inventory management software called GNUKhata >>

Re: Operator is not unique

2019-09-25 Thread PegoraroF10
Doing a inner join with pg_proc I´ll get this result. So, none of this casts I´ve created. Column prorettype is different, this is the problem ?select format_type(castsource, NULL), format_type(casttarget, NULL),castfunc, castcontext, castmethod, pr.* from pg_cast inner join pg_proc pr on castfunc

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Adrian Klaver
On 9/25/19 12:15 AM, Krishnakant Mane wrote: Hello all, I have been using postgresql for an enterprise quality account's automation and inventory management software called GNUKhata Our team is planning to add backup and restore function in the software. But we don't w

Upgrading old server

2019-09-25 Thread Ekaterina Amez
Hi All, We've decided to upgrade our PostgreSQL production servers. First task is remove an old v7.14 version. It was supposed to be upgraded to a v8.4 server. The server was installed, several databases where released here but v7.4 was never migrated. The plan is pg_dump this database and psq

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Krishnakant Mane
On 25/09/19 7:50 PM, Adrian Klaver wrote: > On 9/25/19 12:15 AM, Krishnakant Mane wrote: >> Hello all, >> >> I have been using postgresql for an enterprise quality account's >> automation and inventory management software called GNUKhata >> >> >> Our team is planning to add b

Re: Upgrading old server

2019-09-25 Thread Christoph Berg
Re: Ekaterina Amez 2019-09-25 <8818b028-bd2d-412e-d4e3-e29c49ffe...@zunibal.com> > We've decided to upgrade our PostgreSQL production servers. First task is > remove an old v7.14 version. It was supposed to be upgraded to a v8.4 > server. The server was installed, several databases where released h

Re: Mapping view columns to their source columns

2019-09-25 Thread Tom Lane
Matt Andrews writes: > Incidentally, I have become interested in the pg_node_tree type. I can't > find much info on it. Would that be in the source? What would be the first > steps for writing an extension for this sort of thing? pg_node_tree is just a serialization of the tree-of-Node-structs re

Re: updating sequence value for column 'serial'

2019-09-25 Thread Adrian Klaver
On 9/24/19 10:40 PM, Matthias Apitz wrote: El día martes, septiembre 24, 2019 a las 08:01:46a. m. -0700, Adrian Klaver escribió: On 9/24/19 7:47 AM, Matthias Apitz wrote: Hello, We have in a database some 400 tables, 75 of them have a 'serial' column, like the one in the example table 'tite

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Rob Sargent
> On Sep 25, 2019, at 8:24 AM, Krishnakant Mane wrote: > > >> On 25/09/19 7:50 PM, Adrian Klaver wrote: >>> On 9/25/19 12:15 AM, Krishnakant Mane wrote: >>> Hello all, >>> >>> I have been using postgresql for an enterprise quality account's automation >>> and inventory management sof

Re: Receivgin error while altering the table column datatype

2019-09-25 Thread David G. Johnston
On Wed, Sep 25, 2019 at 5:08 AM Raghavendra Rao J S V < raghavendra...@gmail.com> wrote: > *Reason:* > > *SQL Error [0A000]: ERROR: cannot alter type of a column used in a trigger > definition Detail: trigger extensiontrigger on table tele depends on > column "phonenumber"* > > Do I need to drop

Re: Upgrading old server

2019-09-25 Thread Ron
On 9/25/19 9:29 AM, Christoph Berg wrote: Re: Ekaterina Amez 2019-09-25 <8818b028-bd2d-412e-d4e3-e29c49ffe...@zunibal.com> We've decided to upgrade our PostgreSQL production servers. First task is remove an old v7.14 version. It was supposed to be upgraded to a v8.4 server. The server was instal

Re: Pg_auto_failover

2019-09-25 Thread Sonam Sharma
My user has permission to touch inside the Fs. I am not getting why it is checking for /backup. Any suggestions on this , what else I can check On Wed, Sep 25, 2019, 12:15 AM bricklen wrote: > > > On Tue, Sep 24, 2019 at 8:41 AM Sonam Sharma wrote: > >> I was setting up pg_auto_failover. Have

Re: Upgrading old server

2019-09-25 Thread Tom Lane
Ron writes: > On 9/25/19 9:29 AM, Christoph Berg wrote: >> Re: Ekaterina Amez 2019-09-25 >> <8818b028-bd2d-412e-d4e3-e29c49ffe...@zunibal.com> >>> We've decided to upgrade our PostgreSQL production servers. First task is >>> remove an old v7.14 version. It was supposed to be upgraded to a v8.4 >>

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Michael Lewis
> > If the data is held in common tables(bills, vouchers, etc)then the only > thing I see happening is changing the PK values to an unused value. That > could turn into a nightmare though. Not only that you lose the connection > to the original data source. If the data can be broken out into separa

Re: Pg_auto_failover

2019-09-25 Thread Paul Jungwirth
On 9/25/19 8:55 AM, Sonam Sharma wrote: My user has permission to touch inside the Fs. I am not getting why it is checking for /backup. Any suggestions on this , what else I can check In addition to the code already linked to, I would look at https://github.com/citusdata/pg_auto_failover/blob

Re: Upgrading old server

2019-09-25 Thread Adrian Klaver
On 9/25/19 9:00 AM, Tom Lane wrote: Ron writes: On 9/25/19 9:29 AM, Christoph Berg wrote: Re: Ekaterina Amez 2019-09-25 <8818b028-bd2d-412e-d4e3-e29c49ffe...@zunibal.com> We've decided to upgrade our PostgreSQL production servers. First task is remove an old v7.14 version. It was supposed to

Re: managing primary key conflicts while restoring data to table with existing data

2019-09-25 Thread Adrian Klaver
On 9/25/19 8:04 AM, Rob Sargent wrote: On Sep 25, 2019, at 8:24 AM, Krishnakant Mane > wrote: On 25/09/19 7:50 PM, Adrian Klaver wrote: On 9/25/19 12:15 AM, Krishnakant Mane wrote: Hello all, I have been using postgresql for an enterprise quality account's auto

could not accept SSL connection: sslv3 alert bad certificate

2019-09-25 Thread Marco Ippolito
Following the indications here: https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#configuring-the-database I'm trying to understand how to correctly set Fabric-CA with a PostgreSQL-11 database in Ubuntu 18.04.02 Server Edition. I created a postgresql-11 db to which I can

Re: Operator is not unique

2019-09-25 Thread Adrian Klaver
On 9/25/19 6:38 AM, PegoraroF10 wrote: Doing a inner join with pg_proc I´ll get this result. So, none of this casts I´ve created. Column prorettype is different, this is the problem ? select format_type(castsource, NULL), format_type(casttarget, NULL), castfunc, castcontext, castmethod, pr.* fr

Re: Operator is not unique

2019-09-25 Thread PegoraroF10
format_type format_type castfunccastcontext castmethod bigint smallint714 a f bigint integer 480 a f bigint real652 i f bigint double precision4

Arrays and ANY problem

2019-09-25 Thread David Salisbury
Perhaps someone can guide me here as I'm having a "moment". :) Not sure why I am getting 0 rows returned here: db=# \d table_name_ds_tmp Column | Type| Modifiers +---+--- categoryid | bigint| name | character varying | d

Re: Arrays and ANY problem

2019-09-25 Thread Michael Lewis
> > db=# select name from table_name_ds_tmp where ARRAY[categoryid] = ANY ( > select string_to_array( '200,400', ',')::bigint[] ); > Using either of the below instead, I get the proper result. Why doesn't ANY work? I do not know. select name from table_name_ds_tmp where ARRAY[categoryid] <@ ( sel

Re: Arrays and ANY problem

2019-09-25 Thread Alban Hertroys
> On 25 Sep 2019, at 22:25, David Salisbury wrote: > db=# select name from table_name_ds_tmp where ARRAY[categoryid] = ANY ( > select string_to_array( '200,400', ',')::bigint[] ); > name > -- > (0 rows) You are comparing two arrays for equality. Since the left-hand array has only 1 item

Re: Arrays and ANY problem

2019-09-25 Thread Alban Hertroys
> On 25 Sep 2019, at 22:50, Alban Hertroys wrote: > > >> On 25 Sep 2019, at 22:25, David Salisbury wrote: >> db=# select name from table_name_ds_tmp where ARRAY[categoryid] = ANY ( >> select string_to_array( '200,400', ',')::bigint[] ); >> name >> -- >> (0 rows) > > You are comparing t

Re: Arrays and ANY problem

2019-09-25 Thread David Salisbury
Thanks, Unfortunately I believe I need to include a postgres module to get the "<@" operator, which I have no power to do. This is what I get with that operator.. select name from table_name_ds_tmp where categoryid <@ ANY ( ARRAY[ 200, 400]::BIGINT[] ); ERROR: operator does not exist: bigint

Re: Arrays and ANY problem

2019-09-25 Thread David G. Johnston
On Wed, Sep 25, 2019 at 3:08 PM David Salisbury wrote: > Thanks, > > Unfortunately I believe I need to include a postgres module to get the > "<@" operator, which I have no power to do. This is what I get with that > operator.. > > select name from table_name_ds_tmp where categoryid <@ ANY ( AR

Re: Arrays and ANY problem

2019-09-25 Thread Tom Lane
Alban Hertroys writes: >> On 25 Sep 2019, at 22:50, Alban Hertroys wrote: >> You probably meant: >> select name from table_name_ds_tmp where categoryid = ANY ( select >> string_to_array( '200,400', ',')::bigint[] ); > Or rather: > select name from table_name_ds_tmp where categoryid = ANY ( stri

lc_numeric and negative-prefix

2019-09-25 Thread Andreas Joseph Krogh
Hi. We're having this thread over at https://github.com/impossibl/pgjdbc-ng/issues/420 Can anybody shed som light on when negative-prefix is supposed to be respected by PG's formatting-functions? In lc_numeric='nb_NO.UTF-8' negative-prefix is

Re: lc_numeric and negative-prefix

2019-09-25 Thread Tom Lane
Andreas Joseph Krogh writes: > Can anybody shed som light > on when negative-prefix is supposed to be respected by PG's > formatting-functions? In lc_numeric='nb_NO.UTF-8' negative-prefix is > '−'(8722), > not '-'(45), at least in the JAVA-world, but it seems the JDBC-driver must > use > lc_

Re: lc_numeric and negative-prefix

2019-09-25 Thread Andreas Joseph Krogh
På torsdag 26. september 2019 kl. 00:53:28, skrev Tom Lane mailto:t...@sss.pgh.pa.us>>: Andreas Joseph Krogh writes: > Can anybody shed som light > on when negative-prefix is supposed to be respected by PG's > formatting-functions? In lc_numeric='nb_NO.UTF-8' negative-prefix is '−'(8722), > n

Re: could not accept SSL connection: sslv3 alert bad certificate

2019-09-25 Thread Adrian Klaver
On 9/25/19 12:34 PM, Marco Ippolito wrote: Following the indications here: https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#configuring-the-database I'm trying to understand how to correctly set Fabric-CA with a PostgreSQL-11 database in Ubuntu 18.04.02 Server Editio

Re: could not accept SSL connection: sslv3 alert bad certificate

2019-09-25 Thread Adrian Klaver
On 9/25/19 12:34 PM, Marco Ippolito wrote: Following the indications here: https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#configuring-the-database I'm trying to understand how to correctly set Fabric-CA with a PostgreSQL-11 database in Ubuntu 18.04.02 Server Editio

Re: updating sequence value for column 'serial'

2019-09-25 Thread Matthias Apitz
El día miércoles, septiembre 25, 2019 a las 07:42:11a. m. -0700, Adrian Klaver escribió: > >>> sisis$# DECLARE > >>> sisis$#maxikatkey integer := ( select max(katkey) from titel_daten ); > >>> sisis$#result integer := 1; > >>> sisis$# BEGIN > >>> sisis$#maxikatkey := maxikatkey +1; >

Re: Use of ?get diagnostics'?

2019-09-25 Thread Thiemo Kellner
Hello Adrian Quoting Adrian Klaver : To get above I believe you will need to use GET CURRENT DIAGNOSTICS PG_CONTEXT: I actually use "get stacked diagnostics" to retrieve the exception place. And it works. I am not sure why I did no see it. However, I noticed, that the stack does not incl

Re: Upgrading old server

2019-09-25 Thread Ekaterina Amez
El 25/9/19 a las 20:21, Adrian Klaver escribió: On 9/25/19 9:00 AM, Tom Lane wrote: Ron writes: On 9/25/19 9:29 AM, Christoph Berg wrote: Re: Ekaterina Amez 2019-09-25 <8818b028-bd2d-412e-d4e3-e29c49ffe...@zunibal.com> We've decided to upgrade our PostgreSQL production servers. First task i