Re: Reading all tuples in Index Access Method

2024-08-28 Thread Sushrut Shivaswamy
Thanks Matthias, table_index_build_scan sounds like what I"m looking for. On Wed, Aug 28, 2024 at 9:29 PM Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Wed, 28 Aug 2024 at 16:21, Sushrut Shivaswamy > wrote: > > > > Hi, > > > > I&

Reading all tuples in Index Access Method

2024-08-28 Thread Sushrut Shivaswamy
Hi, I'm trying to create an Index Access Method Roting. Building the index requires iterating over all rows and calculating, which is then used during index construction. The methods in the IndexAmRoutine seem to deal with insertion / index build one row at a time. Is there any workaround you can

Re: Columnar format export in Postgres

2024-06-13 Thread Sushrut Shivaswamy
> > If you want to have any hope, the license must be BSD. > GPL is incompatible. Ack, will update the license to BSD. Thanks On Wed, Jun 12, 2024 at 10:49 PM Ranier Vilela wrote: > Em qua., 12 de jun. de 2024 às 13:56, Sushrut Shivaswamy < > sushrut.shivasw...@gmail.com&g

Re: Columnar format export in Postgres

2024-06-13 Thread Sushrut Shivaswamy
Thanks for the response. I had considered using COPY TO to export columnar data but gave up on it since the formats weren't extensible. It's great to see that you are making it extensible. I'm still going through the thread of comments on your patch but I have some early thoughts about using it f

Columnar format export in Postgres

2024-06-12 Thread Sushrut Shivaswamy
Hey Postgres team, I have been working on adding support for columnar format export to Postgres to speed up analytics queries. I've created an extension that achieves this functionality here . I"m looking to improve the performance of this extension to

Re: Reading timestamp values from Datums gives garbage values

2024-05-21 Thread Sushrut Shivaswamy
Thank you everyone for your responses. I was a bit thrown off by the timestamp value the first time I printed it by how small it was. The revelation that postgres TimestampTz uses an epoch (time zero) of 2000-01-01 helped clarify that value would indeed be smaller than regular UNIX epoch. In my c

Reading timestamp values from Datums gives garbage values

2024-05-20 Thread Sushrut Shivaswamy
Hey, I'm trying to read a timestamp column as EPOCH. My query is as follows. ``` SELECT EXTRACT(EPOCH FROM timestamp_column) FROM table; column -- 1716213097.86486 ``` When running in the console this query gives valid epoch output which appears to be of type double. When trying to read

Re: Background Processes in Postgres Extension

2024-04-27 Thread Sushrut Shivaswamy
Thanks for the suggestion on using postgres background worker. I tried creating one following the implementation in worker_spi and am able to spawn a background worker successfully. However, the background worker seems to cause postmaster to crash when I wait for it to finish using `WaitForBackgr

Read table rows in chunks

2024-04-27 Thread Sushrut Shivaswamy
Hey, I"m trying to read the rows of a table in chunks to process them in a background worker. I want to ensure that each row is processed only once. I was thinking of using the `SELECT * ... OFFSET {offset_size} LIMIT {limit_size}` functionality for this but I"m running into issues. Some approac

Background Processes in Postgres Extension

2024-04-23 Thread Sushrut Shivaswamy
Hey, I'm developing a postgres extension as a custom Table Interface method definition. WIthin the extension, I"m planning to create two background processes using `fork()` that will process data in the background. Are there any recommendations / guidelines around creating background processes wi

Re: Read data from Postgres table pages

2024-03-19 Thread Sushrut Shivaswamy
> > > lol, thanks for the inputs Alexander :)!

Re: Read data from Postgres table pages

2024-03-19 Thread Sushrut Shivaswamy
If we query the DB directly, is it possible to know which new rows have been added since the last query? Is there a change pump that can be latched onto? I’m assuming the page data structs are encapsulated in specific headers which can be used to list / read pages. Why would Postgres need to be

Re: Read data from Postgres table pages

2024-03-19 Thread Sushrut Shivaswamy
The binary I"m trying to create should automatically be able to read data from a postgres instance without users having to run commands for backup / pg_dump etc. Having access to the appropriate source headers would allow me to read the data. On Tue, Mar 19, 2024 at 8:03 PM Sushrut Shiva

Re: Read data from Postgres table pages

2024-03-19 Thread Sushrut Shivaswamy
024 at 4:23 PM Sushrut Shivaswamy > wrote: > > I'm trying to build a postgres export tool that reads data from table > pages and exports it to an S3 bucket. I'd like to avoid manual commands > like pg_dump, I need access to the raw data. > > > > Can you please poi

Read data from Postgres table pages

2024-03-19 Thread Sushrut Shivaswamy
Hey, I'm trying to build a postgres export tool that reads data from table pages and exports it to an S3 bucket. I'd like to avoid manual commands like pg_dump, I need access to the raw data. Can you please point me to the postgres source header / cc files that encapsulate this functionality? -