Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u75D9-00A3wD-Bq for pgsql-general@arkaria.postgresql.org; Tue, 22 Apr 2025 04:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u75D7-00BA1c-1M for pgsql-general@arkaria.postgresql.org; Tue, 22 Apr 2025 04:26:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u75D6-00BA1T-Ez for pgsql-general@lists.postgresql.org; Tue, 22 Apr 2025 04:26:17 +0000 Received: from mail-dm6nam10olkn2081f.outbound.protection.outlook.com ([2a01:111:f403:2c13::81f] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u75D4-001IDR-2W for pgsql-general@lists.postgresql.org; Tue, 22 Apr 2025 04:26:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=usZRdi5NCBZiMdAs2GmJG7G2p0bEmww1dtZLVh6b+QKS3XOQGmfOyTJc/9lGV77Py96dDNParv5vquZ/ppWuHY+cwihgz+T8QIaBEevLFwjqn4bJbth6dON4nLXtsQj3sA1dVbNCT4lIlxh4bqUIHQtmG33pD6mD4eVMEqHl60J1GQQcUYpP/t0hv1O8Vr8sErxlOCpNDy1aF5tU1i3qPUElBq4DXUyyqI2VsETz8359OFnrfUfpthhxddkzkzWxU1d6q98RF7gELqIZ8+trKLJxi7VbUaxUJscsFP+zVMGDVKSh43czLL9zu1Jrex6OItHtK/PGSUfxOs16YAdRfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9JGbo+ffH9XZuGbG+AYdLrjlWVsMnNjKr2kJq7i9uoE=; b=kAPbXhJfRlbXUS2rvTV4x77Ty4KFo9hTE5DHWgA/tU7umjTW8czzxi0p2ih1sYvv2oaGgPo/JD5c6iKT9IrRcy4WmD/lbE/4QLXiGIoY2ZOfc8TTBGW8aGfdY56hkTJNnfOqZyWbiOxc3FC3W7qgJYapB2sfXbBXjbue6QYNi/JKlaTc0ayqwfdUIHFXTc880OVMa3kK95i/DlHQKonKZdgaArC/EkHzvJD2rKD2tcK61pCTTsUNlU/WjqkmKfQakkcuUEWYf59at9OdBxCQowBery6dL8EGaji4YgFk6jpitwl/ZdDpostt5yULXW/isvdTW/zCSWiiwzOdNwbXog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9JGbo+ffH9XZuGbG+AYdLrjlWVsMnNjKr2kJq7i9uoE=; b=vIM6ZWkPh4lRjgbaXDw5nDL+32RC5MNeTDQOWb5N1E2ELs4O6ANljbxOsmsqADQPqXSd1YvxvU+EtsCK7RCdgV8qD5zMbC0TuNlIM9yzqKFm9MiLHmnU/4RlTyMAWePBZBw0jvIT55eafAYv6PdMiR0XtmZtuOkcSmdLMh815YzAsbOhoAebvzaOMPLpANTv3Ey+JZIcbSXlS7rFqATjvUsTRhk0fLF0BR2XjujpTf0IMFKk5/TISe5Ktb/7rp+CYB/BS8sqH9urv8E1Tka7rDKMwANJPWiRtUVf/OLZwzcpcEf1yfuutJe8SCUR/+QQ7rCCrebM47Qk6dUFON9dKw== Received: from LV8P220MB0955.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:1c7::18) by PH0P220MB0572.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:eb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8655.35; Tue, 22 Apr 2025 04:26:10 +0000 Received: from LV8P220MB0955.NAMP220.PROD.OUTLOOK.COM ([fe80::8af8:c1b3:b0b2:a1cb]) by LV8P220MB0955.NAMP220.PROD.OUTLOOK.COM ([fe80::8af8:c1b3:b0b2:a1cb%3]) with mapi id 15.20.8655.030; Tue, 22 Apr 2025 04:26:10 +0000 From: senor To: "pgsql-general@lists" Subject: sequence on daily log partitioned table Thread-Topic: sequence on daily log partitioned table Thread-Index: AQHbsydp9FePlFlSokOGB4va7Gq0Sg== Date: Tue, 22 Apr 2025 04:26:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8P220MB0955:EE_|PH0P220MB0572:EE_ x-ms-office365-filtering-correlation-id: e4f0eaa1-c047-4c60-c31e-08dd8155cf2f x-microsoft-antispam: BCL:0;ARA:14566002|19110799003|8060799006|15030799003|461199028|8062599003|15080799006|7092599003|440099028|3412199025|102099032; x-microsoft-antispam-message-info: =?iso-8859-1?Q?gOB8p+0iRMIZPLOJw1FADjfp12n7LeCU+kw0dLYRdCSxeYcY7iriRwdBRB?= =?iso-8859-1?Q?5CnaFmvypcDa8s1Ux6VanwK4s7DKjkXsChUSRzJj8B4yJbF+veerP4jGWZ?= =?iso-8859-1?Q?HtAZ+c8XSroMHhFTUmf+Z60leEkqhunpGDiVdK80FBpklzWCjeItN0bH4X?= =?iso-8859-1?Q?LCczvvcRgcByUul5jfvxFhbNnmrt3gQ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-8859-1?Q?lBUFbD6EgCNty2v0271iYieZDZwzIxEdoXp4CvjmPHCei+IrnVXFbAFRxu?= =?iso-8859-1?Q?L5P71f4CHgJmMLYKAypkpdlomfoXhw/aIetzMEQY/BNhMvQhUsYl/bJ9B5?= =?iso-8859-1?Q?xFn2PwZCdQlJ5Q=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?AOLl31tV64RpHfK3Z7Nm5OIjiLX+84J6YYUPCdjio0Qdk7jVmi7ayhxgM1?= =?iso-8859-1?Q?W7T+1STlvaXgPYj0Nvk6KGd6mryg7h6RxywDv3E9R+qYb/WESwSNoqCHPM?= =?iso-8859-1?Q?ejb8hpz5prcoI/B+vLwb/BW4R6bje4CQATzcJUnKM0AG4+IqR9OBTVFbZl?= =?iso-8859-1?Q?PoMDsFHGBX2xmYQziUv933r9Zfaf5npR3nFmFyrDs0WySpBGZK1ktQ4EUR?= =?iso-8859-1?Q?pZ3BtkMxczzz2odNXYupRnWR+fqfyIMkt8JP/Z4FvI6iEQ5UEviTRn14Fl?= =?iso-8859-1?Q?D0JcVTcyNmfIAc2pQZUvHb49uRa2sgsun/lagVpERCg3FOImdXynTNO3Tc?= =?iso-8859-1?Q?8e4JgqvQ1+BJ/F6NIjhTTWZvsE1oFLhZi4OIamYdu3DQA7OX5DkY7EddTK?= =?iso-8859-1?Q?OCAbIrew3fCRBgV1hDH6YUsqskSFqpNiAjGcj8sgwZS7zqgXTMkfDuEPBP?= =?iso-8859-1?Q?0ewV59706qeujda/9M9XaqQwQi7IiL0UNqsunsimWVRJ7mgrNeuzzsrR0z?= =?iso-8859-1?Q?anxjEZhf8aq3z8Lcd5uLcPdWh/UHB1nhQsE35OrZyfPcScLSchXoJOBPCX?= =?iso-8859-1?Q?P/aoe+MKlfSWGX3wGWBHUc2ZR3iWXctOoI2tuxorLKEyTL9utAi/9zya6R?= =?iso-8859-1?Q?iNyn5Di9eGVQRHhooxpoMuiElXGUNI+kWkl3enF02cVX9AclqwnrjDcnW7?= =?iso-8859-1?Q?mAAurDLy93HV5qs/nKMmdIGUe6l7K84vkPUXEqQEa9kKAgJLPUbARW7UKi?= =?iso-8859-1?Q?7e7hZorgbSeAfgqJlJP+vmpVb7mSoGkNkafLchNNcV/myEaFQ8PHhJhXQt?= =?iso-8859-1?Q?P8ti4bTm9H3Y9k5No12dY00rqMvFTXKGGncPk8c/cPr8V+2Sq+ZWkyXhvQ?= =?iso-8859-1?Q?n/WpKCkRYChke8oRlPfa/NmmGzPaS7hrBvfSLciqyXGTCxrqf/WXOKbwlq?= =?iso-8859-1?Q?M28hJZqKoZKrUqe9v4ofljT883Dx/tZzDV3x4OqDDbZk3Aeg26W/7fFC+6?= =?iso-8859-1?Q?ePsxZX4TVsPvlUAY55wqWrTdN9WH+qCZeL0bvhbGQHd4RWf/FMoW4fBiA1?= =?iso-8859-1?Q?WMGIheGTHXDdO2sMKlZswT5n8llyy+aAL9xk2iw1U6nUQPqu9LWbuQQbdw?= =?iso-8859-1?Q?4bqpWB/rVhofjFUgkK0vsKSJ1gPAAnsFUQ9P7RcB67U9mfibIp418eY0O1?= =?iso-8859-1?Q?oVIEmHoEBQ2AeUHaKC/GQGioVfumanw8NPv+gH64P5I1wG5hDf/jWfhxl0?= =?iso-8859-1?Q?8xxyNlQB4nxnvwfNM+DFHhzIBDJoBt2JEBEgCzBXg=3D?= Content-Type: multipart/alternative; boundary="_000_LV8P220MB09555DBF54A6F74131D92D88F7BB2LV8P220MB0955NAMP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-17562.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8P220MB0955.NAMP220.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e4f0eaa1-c047-4c60-c31e-08dd8155cf2f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2025 04:26:10.4232 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0P220MB0572 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_LV8P220MB09555DBF54A6F74131D92D88F7BB2LV8P220MB0955NAMP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, I'm mainly interested in understanding how this works or why it can't, as o= pposed to just solving the problem. AI just told me this can't be done with= out a trigger but I'd like to confirm in case maybe I just asked the wrong = question. I want to have a partitioned log table receiving input from sensor equipmen= t. The partitions would cover some time range like an hour or day. In all c= ases I want an ID column to default to a nextval from a sequence but starti= ng over for each day. If I set the default on the partitioned table, I woul= d need to alter it at midnight - not optimal. A default set on the partitio= n hasn't worked and I'm not sure why this is a problem. I've only ever used simplistic partitioning but this doesn't seem like an u= nusual need. I'm looking for the underlying strategy that prevents use of t= he sequence configured on the partition. A reference to something describin= g the decision flow would be fantastic. I've been experimenting on version 13 out of convenience but if a newer ver= sion has relevant changes, I'm interested. I'm not interested in the discus= sions over whether the data volume is enough to justify partitioning. Thanks in advance, Senor --_000_LV8P220MB09555DBF54A6F74131D92D88F7BB2LV8P220MB0955NAMP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi All,

I'm mainly interested in understanding how this works or why it can't, as o= pposed to just solving the problem. AI just told me this can't be done with= out a trigger but I'd like to confirm in case maybe I just asked the wrong = question.

I want to have a partitioned log table receiving input from sensor equipmen= t. The partitions would cover some time range like an hour or day. In all c= ases I want an ID column to default to a nextval from a sequence but starti= ng over for each day. If I set the default on the partitioned table, I would need to alter it at midnight - n= ot optimal. A default set on the partition hasn't worked and I'm not sure w= hy this is a problem. 

I've only ever used simplistic partitioning but this doesn't seem like an u= nusual need. I'm looking for the underlying strategy that prevents use of t= he sequence configured on the partition. A reference to something describin= g the decision flow would be fantastic.

I've been experimenting on version 13 out of convenience but if a newer ver= sion has relevant changes, I'm interested. I'm not interested in the discus= sions over whether the data volume is enough to justify partitioning. =

Thanks in advance,
Senor
--_000_LV8P220MB09555DBF54A6F74131D92D88F7BB2LV8P220MB0955NAMP_--