Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmiya-00068q-6X for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 22:30:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmiyY-000713-5x for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 22:30:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmiyX-00070e-P0 for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 22:30:01 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pmiyU-002WXd-Pz for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 22:30:00 +0000 Received: by mail-pj1-x1030.google.com with SMTP id g3so14423680pja.2 for ; Wed, 12 Apr 2023 15:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681338596; x=1683930596; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=aiz3AGotZDCP38A8KZGxkFt9VXine5Os4i3x4be4Lkc=; b=AHDexp1USV9x2SeWtTD8I6FfG08S40UF4S3Z93zHj4Ljb/qr/LQDhpGctd+fwtwjEw w/rhhG7S145KbpRi6PMQmftqSys3HgaA1ugQMzSqydJqXUncsDn+ujgTW9O5r7L0yTiC sylXo+bHaH4cTFgu1wt0gOY5F0JWFqI7nzqq5xUxFQoyJ7nVuaP8MMjDM7x6xwFkQs7e gd4wHrxyn8kSOnsCkiqu2Qe8Apv7U4QlkX1Hq/tlToEjQCpDxSQJlQ8jCFtpnvAOH3ym 03k5seA92TMuYELGSIpG5FqcUtMlKC1n+I51SUW5P2peyFJdKXC5/ufmpOKrovg9nNZm DIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681338596; x=1683930596; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aiz3AGotZDCP38A8KZGxkFt9VXine5Os4i3x4be4Lkc=; b=i+8k51zl6Nx/hhh70NLXlvUTnlC7tHlfrhQjZtRtNz1AfEs0VzeXuuul98suWV9tRt z3FUZrwXumoWuh5s50+OFEFR+BZSyuJhyibmRoixME1W4hP8UxOc6tN+h8N6yKB1ATp8 nyzQ2HbXEpOZkPc4iM2lFTFhr2LzWmKp+9hWqBcgAETKHyCRbJq5UPlJFfqyiRDdA379 nddmwHCwPrzzcfXblDFM3eEeoRE2F2xMf6+g8fWgOkKjnxyitgM2HQwnQeCDsV0wA+gK lDsQvXL13EhaxzMmnfLnxeywy3QfNCH3VGPBDzrlOxdADHPcXOoe/Bc/BMIy43zXbssj WsSg== X-Gm-Message-State: AAQBX9eWZaVMeNec0CBSnl3jNdhaPvkMV7+Hz9HeN3LhfT1V3Ie9ERZt 1ErOOhLZAuf2JSOVh1dFbPYgH4YZ9Lc= X-Google-Smtp-Source: AKy350Z8kNCI/kdbWszVke//VugyE6Ip8gVNWKSQ1zPEdOsdS4Q9QdRYOZWsQpwfsnsFNh8DQAiN5w== X-Received: by 2002:a17:90b:3e82:b0:246:b4b4:555f with SMTP id rj2-20020a17090b3e8200b00246b4b4555fmr10682754pjb.7.1681338596045; Wed, 12 Apr 2023 15:29:56 -0700 (PDT) Received: from ?IPV6:2601:681:5a00:f790:7096:ab4:cda6:9ce7? ([2601:681:5a00:f790:7096:ab4:cda6:9ce7]) by smtp.gmail.com with ESMTPSA id x8-20020a17090a1f8800b0023fbb21214bsm1940946pja.17.2023.04.12.15.29.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Apr 2023 15:29:55 -0700 (PDT) Message-ID: <0c1bbc5c-0215-5c27-5507-c8eb2e56f248@gmail.com> Date: Wed, 12 Apr 2023 16:29:54 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Guidance on INSERT RETURNING order Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: <95fbd8c8-2f7a-38a1-4a41-b2ac3763d89c@aklaver.com> From: Rob Sargent In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > This would be a nice solution… but the PK could be always generated, > or not even sequential (UUIDs for example). If you’re developing > schema-first the application would not even (need to) know about how > the IDs are generated as it’s the DB that generates them. > > AIUI the OP’s an SQLAlchemy developer, which is an ORM. Therefore he > needs a generic solution. Or a different dev env. :)