Re: [GENERAL] LEFT JOIN, entry can not be referenced

2017-06-26 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Jun 26, 2017 at 5:31 PM, Jan Danielsson > wrote: >> SELECT >> wl.ts,wa.name,wl.user_id,u.name,wl.doc_id,d.doc_id,wl. >> docrev_id,dr.docrev,wl.file_id,f.fname,wl.issue >> FROM worklogs AS wl,

Re: [GENERAL] Config for fast huge cascaded updates

2017-06-26 Thread Joshua D. Drake
On 06/26/2017 06:29 PM, Andrew Sullivan wrote: On Tue, Jun 27, 2017 at 10:17:49AM +1200, Craig de Stigter wrote: We're doing a large migration on our site which involves changing most of the primary key values. We've noticed this is a *very* slow process. You can make it faster through a

Re: [GENERAL] Config for fast huge cascaded updates

2017-06-26 Thread Andrew Sullivan
On Tue, Jun 27, 2017 at 10:17:49AM +1200, Craig de Stigter wrote: > We're doing a large migration on our site which involves changing most of > the primary key values. We've noticed this is a *very* slow process. Indeed. Does the database need to be online when this is happening? If it were me,

Re: [GENERAL] LEFT JOIN, entry can not be referenced

2017-06-26 Thread David G. Johnston
On Mon, Jun 26, 2017 at 5:31 PM, Jan Danielsson wrote: > SELECT > wl.ts,wa.name,wl.user_id,u.name,wl.doc_id,d.doc_id,wl. > docrev_id,dr.docrev,wl.file_id,f.fname,wl.issue > FROM worklogs AS wl, workactions AS wa, users AS u > LEFT JOIN documents AS d ON wl.doc_id=d.id

[GENERAL] LEFT JOIN, entry can not be referenced

2017-06-26 Thread Jan Danielsson
Hello, I'm trying to use LEFT JOIN's in a manner which I imagine is pretty archetypal. In short; I have a table called worklogs which has a few columns that can't be NULL, and a few columns which may reference other tables or will be NULL. If the optional columns are not NULL I want to use

Re: [GENERAL] When inserting from a SELECT with an ORDER BY, are the inserts (and associated triggers) applied in order?

2017-06-26 Thread Jim Fulton
On Mon, Jun 26, 2017 at 5:43 PM, Tom Lane wrote: > Jim Fulton writes: > > When inserting from a SELECT with an ORDER BY, are the inserts (and > > associated triggers) applied in order? > > Yeah, I'd expect so. I'm not sure we'd promise that that will

Re: [GENERAL] Config for fast huge cascaded updates

2017-06-26 Thread Tom Lane
Craig de Stigter writes: > We're doing a large migration on our site which involves changing most of > the primary key values. We've noticed this is a *very* slow process. > Firstly we've set up all the foreign keys to use `on update cascade`. Then > we

[GENERAL] Config for fast huge cascaded updates

2017-06-26 Thread Craig de Stigter
Hi folks We're doing a large migration on our site which involves changing most of the primary key values. We've noticed this is a *very* slow process. Firstly we've set up all the foreign keys to use `on update cascade`. Then we essentially do this on every table: UPDATE TABLE users SET id =

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Adrian Klaver
On 06/26/2017 01:10 PM, Paul A Jungwirth wrote: On Mon, Jun 26, 2017 at 12:47 PM, Adrian Klaver wrote: On 06/26/2017 12:03 PM, Paul Jungwirth wrote: Perhaps you should see what is line 85 when you do `\sf words_skip_game` (rather than line 85 in your own source

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Adrian Klaver
On 06/26/2017 01:10 PM, Paul A Jungwirth wrote: On Mon, Jun 26, 2017 at 12:47 PM, Adrian Klaver wrote: On 06/26/2017 12:03 PM, Paul Jungwirth wrote: Perhaps you should see what is line 85 when you do `\sf words_skip_game` (rather than line 85 in your own source

Re: [GENERAL] When inserting from a SELECT with an ORDER BY, are the inserts (and associated triggers) applied in order?

2017-06-26 Thread Tom Lane
Jim Fulton writes: > When inserting from a SELECT with an ORDER BY, are the inserts (and > associated triggers) applied in order? Yeah, I'd expect so. I'm not sure we'd promise that that will always remain true, but I can't think why it would be violated at the moment. >

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Paul A Jungwirth
On Mon, Jun 26, 2017 at 12:47 PM, Adrian Klaver wrote: > On 06/26/2017 12:03 PM, Paul Jungwirth wrote: >> Perhaps >> you should see what is line 85 when you do `\sf words_skip_game` (rather >> than line 85 in your own source code). > > Or easier yet: > >

[GENERAL] When inserting from a SELECT with an ORDER BY, are the inserts (and associated triggers) applied in order?

2017-06-26 Thread Jim Fulton
When inserting from a SELECT with an ORDER BY, are the inserts (and associated triggers) applied in order? It looks like inserts aren't applied in order, and I'm wondering if this is something I should expect. Jim -- Jim Fulton http://jimfulton.info

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Adrian Klaver
On 06/26/2017 12:03 PM, Paul Jungwirth wrote: On 06/26/2017 11:21 AM, Alexander Farber wrote: The error message returned by the database is rather cryptic: words=> select * from words_skip_game(1, 1); ERROR: query returned no rows CONTEXT: PL/pgSQL function words_skip_game(integer,integer)

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Paul Jungwirth
On 06/26/2017 11:21 AM, Alexander Farber wrote: The error message returned by the database is rather cryptic: words=> select * from words_skip_game(1, 1); ERROR: query returned no rows CONTEXT: PL/pgSQL function words_skip_game(integer,integer) line 85 at SQL statement When I look at my

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Alexander Farber
In my case _opponent was NULL and there are no records in words_users with PK uid being NULL... so that was the reason. Thank you

Re: [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Alexander Farber
Hi again, On Mon, Jun 26, 2017 at 8:21 PM, Alexander Farber < alexander.far...@gmail.com> wrote: > > words=> select * from words_skip_game(1, 1); > ERROR: query returned no rows > CONTEXT: PL/pgSQL function words_skip_game(integer,integer) line 85 at > SQL statement > > When I look at my

Re: [SPAM] [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Alexander Farber
On Mon, Jun 26, 2017 at 8:39 PM, Moreno Andreo wrote: > Il 26/06/2017 20:21, Alexander Farber ha scritto: > >> >> RETURNING >> player1, >> score2, >> score1 >> INTO

Re: [SPAM] [GENERAL] ERROR: query returned no rows

2017-06-26 Thread Moreno Andreo
Il 26/06/2017 20:21, Alexander Farber ha scritto: RETURNING player1, score2, score1 INTO _opponent, _score1, -- the line 85

[GENERAL] ERROR: query returned no rows

2017-06-26 Thread Alexander Farber
Good evening, with PostgreSQL 9.5 I have extended a larger custom function, which has worked well before and my problem is that the error message returned by the database is rather cryptic: words=> select * from words_skip_game(1, 1); ERROR: query returned no rows CONTEXT: PL/pgSQL function

Re: [GENERAL] Configure Qt Creator to work with PostgreSQL to extensions development

2017-06-26 Thread Arthur Zakirov
On Sunday, 25 June 2017 17:34:11 MSK, Fabiana Zioti wrote: > I'm creating an extension to PostgreSQL, with user-defined types and > user-defined functions. > > Extensions can be written in C as well as C ++, correct? > I am currently using ATOM to develop in Ubuntu. But I would like to work >