Re: Need exact SQL query to find List of Detach Partitioned Tables (Yet to be Dropped)

2024-11-15 Thread Adrian Klaver
On 11/15/24 11:46, Bharani SV-forum wrote:  Team Need exact SQL query to find List of Detach Partitioned Tables (Yet to be Dropped) The following is the query which i used, i am using and i found an bug which is listing an newly created table (last week) As David G. Johnston said how woul

Re: Need exact SQL query to find List of Detach Partitioned Tables (Yet to be Dropped)

2024-11-15 Thread David G. Johnston
On Fri, Nov 15, 2024 at 12:46 PM Bharani SV-forum wrote: > Need exact SQL query to find List of Detach Partitioned Tables (Yet to be > Dropped) > > The premise that a detached table is distinguishable from any other table that is not a partition is an interesting one that I wouldn't necessarily e

Need exact SQL query to find List of Detach Partitioned Tables (Yet to be Dropped)

2024-11-15 Thread Bharani SV-forum
 Team Need exact SQL query to find List of Detach Partitioned Tables (Yet to be Dropped) The following is the query which i used, i am using and i found an bug which is listing an newly created table (last week) SELECT relnamespace::regnamespace::text AS schema_name, relname AS table_name FROM  

Re: Retrieve filename within a script

2024-11-15 Thread Vincent Veyron
On Thu, 14 Nov 2024 08:42:36 + Patrick FICHE wrote: > I was wondering if it was possible to get the filename provided as an > argument to psql. > psql -f /tmp/test.sql > Since you know it already, you could pass it as a variable : psql -f /tmp/test.sql -v my_path='/tmp/test.sql' and retr

Re: DB Files

2024-11-15 Thread Andy Hartman
Thanks... I just found that myself... so normal behavior then... On Fri, Nov 15, 2024 at 10:47 AM Adrian Klaver wrote: > On 11/15/24 06:27, Andy Hartman wrote: > > I created a new table (V16) and then used SimplySql to take data from > > mssql to the new Postgres table. The table is 212gig in s

Re: DB Files

2024-11-15 Thread Torsten Förtsch
PG normally splits table data into 1GB chunks. The number before the dot is called the filenode. You can translate it into a table name by select oid::regclass::text from pg_class where relfilenode='2474695'; I believe there is an option to change that chunk size but you'd have to recompile Postg

Re: Retrieve filename within a script

2024-11-15 Thread Adrian Klaver
On 11/14/24 00:42, Patrick FICHE wrote: Hi, I was wondering if it was possible to get the filename provided as an argument to psql. Not that I know of. psql -f /tmp/test.sql I would like a command in test.sql that would be able to retrieve the full pathname (/tmp/test.sql). Regards, P

Re: DB Files

2024-11-15 Thread Adrian Klaver
On 11/15/24 06:27, Andy Hartman wrote: I created a  new table (V16) and then used SimplySql to take data from mssql to the new Postgres table. The table is 212gig in size. Myquestion comes from the files created on the OS(Windows2022 server) I can see lots of files with the last being: 247469

Re: Validating check constraints without a table scan?

2024-11-15 Thread Torsten Förtsch
On Fri, Nov 15, 2024 at 9:38 AM Philip Couling wrote: > Is there a solid reason why adding a check constraint does not use > existing indexes for validation. > > We are currently looking at partitioning a multi TB table leaving all > existing data in place and simply attaching it as a partition t

DB Files

2024-11-15 Thread Andy Hartman
I created a new table (V16) and then used SimplySql to take data from mssql to the new Postgres table. The table is 212gig in size. Myquestion comes from the files created on the OS(Windows2022 server) I can see lots of files with the last being: 2474695.143 They are all 1,048,576kb Is this nor

Re: Validating check constraints without a table scan?

2024-11-15 Thread Laurenz Albe
On Thu, 2024-11-14 at 21:33 +, Philip Couling wrote: > Is there a solid ready why validating check constraints cannot use existing > indexes? > If I can prove the constraint is valid so trivially with a SELECT, then why > can > Postgres not do the same (or similar)? I assume that the simple

Validating check constraints without a table scan?

2024-11-15 Thread Philip Couling
Is there a solid reason why adding a check constraint does not use existing indexes for validation. We are currently looking at partitioning a multi TB table leaving all existing data in place and simply attaching it as a partition to a new table. To prevent locking, we are trying to add an INVALI