Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsgWz-0004Pp-8v for pgsql-general@arkaria.postgresql.org; Sun, 10 Feb 2019 04:15:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsgWx-0005o9-TC for pgsql-general@arkaria.postgresql.org; Sun, 10 Feb 2019 04:15:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsgWx-0005nw-Fl for pgsql-general@lists.postgresql.org; Sun, 10 Feb 2019 04:15:47 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsgWu-0000Ks-V2 for pgsql-general@postgresql.org; Sun, 10 Feb 2019 04:15:46 +0000 Received: by mail-pl1-x641.google.com with SMTP id f90so3405585plb.10 for ; Sat, 09 Feb 2019 20:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=zXGErO0oTi5RNzLFoSoQKxJfekrAZeMl+zIjAQVMPJI=; b=luEEKfE/8Jp2DeJi/2WjXtcRlmFXBABRdFxoLUYqmZHfX1hGHcFpnYdKGze2fDcWeA jX7/fTuraS/6IyCCKviSugEOq5RikcCe1Gi0MeICFOmy5NCOUF0dRaMdRduMc6pN85PP 5+HDTWq9DnjS39m5iXLHB4234kLLVrlfwFYApTu2BFTy5DvLV4kk/+wpAwT9GO/ZdP/N nF2flABA7Rj930bGB00Xvm5qR4xJZ4cWqOh7ErLt8lJeiQSLo83rUMedeZMTmzjbvaHv 0Oba7a/4E12h0K/GZCE9D6orX9CYYBHe9oeWgmlFnRxPJcLkF7Gjc4T8cQnphTZG0Cw1 iwXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=zXGErO0oTi5RNzLFoSoQKxJfekrAZeMl+zIjAQVMPJI=; b=UTgek4xHA8l1kdgmTOUZ49gy/sIJIo90kbcmL6bqG+/Iy+kxQU+1cVOFJHhrd2cuwz ICuDrq4aLBo8Pw9B/Ee7RcnQyz5FuOkZs/kdWYIhXuyadsr/8cuNsz/y3siJWN6ysqN2 +BDP2BkiZFUajvhqkB2bkzNYKWlfjrIfytJ6MVCTSuEf43/BLu/9TrgYKcGbp8VTAB+k tE/ogb6Wr59quuCvqyb5c2uUFPmFdEIUN27hUzKb8HNP3E2mbGWpNWbDClFFAU7Cd72p jiNr4UFP4ZHSMoETsEkPsW596fZOa0K7pZ9hopSdTdBMySvlDUdrRGNKgFaptXpVlWQ8 NGdA== X-Gm-Message-State: AHQUAubQPPEAEvMBnUw8cINwm4IBe6zRwoSLYRH5lJgZ8zFR4IDAI2eO zZJWyX1XpBOlau3YKjmW4Dk= X-Google-Smtp-Source: AHgI3IY+6j0j3O4mT1t48gNJY3yzy56162S825CyRSrpncvoIhbg2QBg4FYpUjnQll3e6+jl3wt4uw== X-Received: by 2002:a17:902:b101:: with SMTP id q1mr31150357plr.135.1549772143829; Sat, 09 Feb 2019 20:15:43 -0800 (PST) Received: from 192-168-1-104.tpgi.com.au ([61.69.131.212]) by smtp.gmail.com with ESMTPSA id z13sm9109534pgf.84.2019.02.09.20.15.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Feb 2019 20:15:43 -0800 (PST) Message-ID: Subject: Re: Server goes to Recovery Mode when run a SQL From: rob stone To: Justin Pryzby , PegoraroF10 Cc: pgsql-general@postgresql.org Date: Sun, 10 Feb 2019 15:15:38 +1100 In-Reply-To: <20190209214651.GP31721@telsasoft.com> References: <1549209182255-0.post@n3.nabble.com> <1549209942200-0.post@n3.nabble.com> <1549660293178-0.post@n3.nabble.com> <20190209214651.GP31721@telsasoft.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.4-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Sat, 2019-02-09 at 15:46 -0600, Justin Pryzby wrote: > Hi, > > > > "segfault" seems to mean you hit a bug, which we'll want more > information to > diagnose. Could you install debugging symbols ? Ubuntu calls their > package > postgresql-10-dbg or similar. And start server with coredumps > enabled, using > pg_ctl -c -D /var/lib/postgresql/10/main (or similar). Then trigger > the query > and hope to find a core dump in the data directory. Or possibly > it'll be > processed into /var/crash by apport daemon, depending if that's > running and > enabled (check /proc/sys/kernel/core_pattern). > I believe there is a bug. I've examined the query Marcos sent with his first post and I think the parser should have listed some errors and not tried to run the query. I'm probably wrong but consider the following. Around line 33 of the query:- tsrange(col_aula.data, (col_aula.data + (col_aula.tempo|| ' minute')::interval)) dia, 0 prevista, (extract(EPOCH FROM col_aula.tempo) / 60) minutosassistidos Assuming column col_aula.tempo is of type INTEGER, is NOT NULL and let's say contains a value of 60, then it parses as tsrange(col_aula.data, (col_aula.data + (60' minute')::interval)) which would pull a syntax error. You cannot extract EPOCH from a column that is of type INTEGER. Another syntax error. Down around line 87 onwards there are generate_series without any parameters, and further dubious usage of EPOCH, as well as DOW. Not having the table definitions is obviously clouding the analysis. If there is a bug in the parser, then one of the experts will have to opine about that. HTH, Robert