[GENERAL] FK check implementation

2014-10-10 Thread Nick Barnes
I'm looking at the code behind the foreign key checks in ri_triggers.c, and something's got me a little confused. In both cases (FK insert/update checking the PK, and PK update/delete checking the FK) the check is done with a SELECT ... FOR KEY SHARE. This makes perfect sense for PK checks, but i

Re: [GENERAL] PostgreSQL server won't start, corrupt?

2014-10-10 Thread Merlin Moncure
On Thu, Oct 9, 2014 at 3:30 PM, Rob Flemming wrote: > Hi I've had a a PostgreSQL 9.3 server running on Windows 7 for several > months. > > While trying to diagnose a remote computer's connection problem (through > ArcGIS, grrr), i was clicking through the postgres (data) directory and > opened a

Re: [GENERAL] FK check implementation

2014-10-10 Thread Tom Lane
Nick Barnes writes: > I'm looking at the code behind the foreign key checks in ri_triggers.c, and > something's got me a little confused. > In both cases (FK insert/update checking the PK, and PK update/delete > checking the FK) the check is done with a SELECT ... FOR KEY SHARE. > This makes per

[GENERAL] org.postgresql.copy.CopyManager which JDBC version ?

2014-10-10 Thread Emi Lu
Hello, May I know from which version of psql JDBC driver, it provides "org.postgresql.copy.CopyManager" please? postgresql-8.3-605.jdbc4.jar does not have this class. Thanks a lot! Emi -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] org.postgresql.copy.CopyManager which JDBC version ?

2014-10-10 Thread Tim Clarke
On 10/10/14 16:14, Emi Lu wrote: > Hello, > > May I know from which version of psql JDBC driver, it provides > "org.postgresql.copy.CopyManager" please? > > postgresql-8.3-605.jdbc4.jar does not have this class. > > Thanks a lot! > Emi Its present in both the JDB3 and JDBC4 jar files on my 14.04 U

Re: [GENERAL] org.postgresql.copy.CopyManager which JDBC version ?

2014-10-10 Thread Tim Clarke
On 10/10/14 16:22, Tim Clarke wrote: > On 10/10/14 16:14, Emi Lu wrote: >> Hello, >> >> May I know from which version of psql JDBC driver, it provides >> "org.postgresql.copy.CopyManager" please? >> >> postgresql-8.3-605.jdbc4.jar does not have this class. >> >> Thanks a lot! >> Emi > Its present i

Re: [GENERAL] org.postgresql.copy.CopyManager which JDBC version ?

2014-10-10 Thread Adrian Klaver
On 10/10/2014 08:14 AM, Emi Lu wrote: Hello, May I know from which version of psql JDBC driver, it provides "org.postgresql.copy.CopyManager" please? postgresql-8.3-605.jdbc4.jar does not have this class. Well according to this: http://jdbc.postgresql.org/documentation/pgjdbc_changelog-8.0-8

[GENERAL] psql generate insert command based on select

2014-10-10 Thread Leonardo M. Ramé
Hi, today I needed to re-create certain records deleted from a mysql database, so I restored an old backup, opened a terminal and logged in to the old database using the "mysql" command line utility, then opened a new terminal with mysql connected to the production database. Then did a "select

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread Adrian Klaver
On 10/10/2014 10:27 AM, "Leonardo M. Ramé" wrote: Hi, today I needed to re-create certain records deleted from a mysql database, so I restored an old backup, opened a terminal and logged in to the old database using the "mysql" command line utility, then opened a new terminal with mysql connected

Re: [GENERAL] FK check implementation

2014-10-10 Thread Nick Barnes
On Sat, Oct 11, 2014 at 1:32 AM, Tom Lane wrote: > Nick Barnes writes: > > I'm looking at the code behind the foreign key checks in ri_triggers.c, > and > > something's got me a little confused. > > > In both cases (FK insert/update checking the PK, and PK update/delete > > checking the FK) the

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread Leonardo M. Ramé
El 10/10/14 a las 14:37, Adrian Klaver escibió: On 10/10/2014 10:27 AM, "Leonardo M. Ramé" wrote: Hi, today I needed to re-create certain records deleted from a mysql database, so I restored an old backup, opened a terminal and logged in to the old database using the "mysql" command line utilit

Re: [GENERAL] Understanding and implementing a GiST Index

2014-10-10 Thread Connor Wolf
I had skimmed the presentation slides, but I hadn't looked that closely because it appeared to be using cosine similarity metrics, and only operated on matrices, neither of which are what I wanted. On closer examination, I think I could explode my packed hash values to a matrix. I'm not sure h

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread vibhor.ku...@enterprisedb.com
On Oct 10, 2014, at 1:27 PM, Leonardo M. Ramé wrote: > Hi, today I needed to re-create certain records deleted from a mysql > database, so I restored an old backup, opened a terminal and logged in to the > old database using the "mysql" command line utility, then opened a new > terminal with

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread Adrian Klaver
On 10/10/2014 10:42 AM, "Leonardo M. Ramé" wrote: El 10/10/14 a las 14:37, Adrian Klaver escibió: On 10/10/2014 10:27 AM, "Leonardo M. Ramé" wrote: Hi, today I needed to re-create certain records deleted from a mysql database, so I restored an old backup, opened a terminal and logged in to the

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread Leonardo M. Ramé
El 10/10/14 a las 14:50, vibhor.ku...@enterprisedb.com escibió: On Oct 10, 2014, at 1:27 PM, Leonardo M. Ramé wrote: Hi, today I needed to re-create certain records deleted from a mysql database, so I restored an old backup, opened a terminal and logged in to the old database using the "my

Re: [GENERAL] FK check implementation

2014-10-10 Thread Adrian Klaver
On 10/10/2014 10:41 AM, Nick Barnes wrote: I understand why the FK insert needs to lock on the PK row. But why is the PK delete trying to lock the FK row? If it finds one, won't the delete fail anyway? If it doesn't find one, what is there to lock? I would say this has to do with setting DEF

Re: [GENERAL] psql generate insert command based on select

2014-10-10 Thread vibhor.ku...@enterprisedb.com
On Oct 10, 2014, at 1:52 PM, Leonardo M. Ramé wrote: > > El 10/10/14 a las 14:50, vibhor.ku...@enterprisedb.com escibió: >> >> On Oct 10, 2014, at 1:27 PM, Leonardo M. Ramé wrote: >> >>> Hi, today I needed to re-create certain records deleted from a mysql >>> database, so I restored an old

Re: [GENERAL] Converting char to varchar automatically

2014-10-10 Thread Jim Nasby
On 10/9/14, 12:41 AM, Andrus wrote: Hi! >There really is no easy way to make a single ALTER for each table unless you use a programming language. I’snt SQL a programming language ? >However, adding a GROUP BY c.relname,a.attname >would certainly simplify editing. Then you can combine all the

Re: [GENERAL] psql connection issue

2014-10-10 Thread Jim Nasby
FWIW, you could also use an IP connection to Postgres instead of the local socket. On 10/8/14, 6:34 PM, Stephen Davies wrote: This is not the same issue. However, I had already disabled SELinux for other reasons. The actual cause of my issue was the "new" private tmp facility in systemd start

Re: [GENERAL] How to synchronize tables in remote (production) and local databases in case if the structure of local database's table has been modified

2014-10-10 Thread Jim Nasby
On 10/8/14, 2:49 AM, Vitaly Isaev wrote: Hello, I have faced with a complicated case of table synchronisation. The full description of the problem (with some figures) is posted here: http://stackoverflow.com/questions/26237661/postgresql-update-table-with-new-records-from-the-same-table-on-remo

Re: [GENERAL] table versioning approach (not auditing)

2014-10-10 Thread Jim Nasby
On 10/7/14, 10:40 PM, Gavin Flower wrote: Yeah, I'm pretty convinced at this point that history/versioning should be built on top of a schema that always contains the current information, if for no other reason than so you always have a PK that points to what's current in addition to your hist

Re: [GENERAL] Processor usage/tuning question

2014-10-10 Thread Jim Nasby
On 10/8/14, 3:17 PM, Israel Brewster wrote: Except that the last data point received is still valid as the aircraft's current location, even if it came in several hours ago - which we may well care about. That is, some users may need to see where a given aircraft (or the entire fleet) is, even

Re: [GENERAL] psql connection issue

2014-10-10 Thread Stephen Davies
Yes but that would have involved changing hundreds of CGI scripts. Dropping the private tmp was easier. On 11/10/14 07:01, Jim Nasby wrote: FWIW, you could also use an IP connection to Postgres instead of the local socket. On 10/8/14, 6:34 PM, Stephen Davies wrote: This is not the same issue.

Re: [GENERAL] Processor usage/tuning question

2014-10-10 Thread Jeff Janes
On Fri, Oct 10, 2014 at 2:04 PM, Jim Nasby wrote: > On 10/8/14, 3:17 PM, Israel Brewster wrote: > >> Except that the last data point received is still valid as the aircraft's >> current location, even if it came in several hours ago - which we may well >> care about. That is, some users may need