Postgres read jsonb content from stdin

2020-12-26 Thread Markur Sens
Hello, I'm trying to build a few data pipelines with Unix tools but can't figure out how to insert in a slurp mode (e.g. not COPY line by line) content inside a variable. Consider the following script (using a heredoc) json_url="https://file.json"; local_file="/tmp/a.json" curl -s -m 10 -A

Re: Postgres read jsonb content from stdin

2020-12-26 Thread Markur Sens
intricacies but it'd still emit to stdout. (hence the curl simplified in the example) On Sat, Dec 26, 2020 at 2:40 PM Ian Lawrence Barwick wrote: > 2020年12月26日(土) 20:19 Markur Sens : > > > > Hello, > > > > I'm trying to build a few data pipelines with Unix tools

Docker Image with Python support ?

2021-01-13 Thread Markur Sens
Is there any available Postgres image that has been compiled with the --with-python flag? I could use and modify (comment out this) https://github.com/docker-library/postgres/blob/03e769531fff4c97cb755e4a608b24935c27/13/alpine/Dockerfile but looks like too much for a simple flag.

Alternative to slow SRF in SELECT?

2022-05-17 Thread Markur Sens
I have the following case select my_srf_func(otherfunc(h)) from (values (‘…’::mytype), ‘…’::mytype), (‘…’::mytype), ‘…’::mytype), (‘…’::mytype),) as temp(h); I think it’s obvious what I’m trying to do. My_srf_func is similar

PG_GETARG_TEXT_PP vs PG_GETARG_TEXT_P

2022-06-11 Thread Markur Sens
In the “Extending SQL” chapter I see both of these forms are mentioned. But can’t find info about when to use which one.

Re: PG_GETARG_TEXT_PP vs PG_GETARG_TEXT_P

2022-06-11 Thread Markur Sens
> On 12 Jun 2022, at 12:06 AM, Tom Lane wrote: > > Markur Sens writes: >> In the “Extending SQL” chapter I see both of these forms are mentioned. >> But can’t find info about when to use which one. > > PG_GETARG_TEXT_P returns a traditional-

Using vars in jsonbpath operator ?

2023-06-16 Thread Markur Sens
I understand that on a where clause a gin index can be used for the following predicate a.data @? '$.results.docs[*].accs[*] ? (@.id == “123") I have a join query however on the following condition jsonb_path_exists(a.data, '$.results.docs[*].accs[*] ? (@.number == $id)', jsonb_build_object(‘i

Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?

2024-03-07 Thread Markur Sens
> On 7 Mar 2024, at 4:56 PM, Achilleas Mantzios - cloud > wrote: > > Hello > > I notice both my kids struggling with either C or Python as first programming > languages. I believe both are unsuitable for use as introductory languages to > college juniors. https://scratch.mit.edu/ would be

CI/CD Boilerplate for extension binaries without source code ?

2022-01-10 Thread Markur Sens
Hi, For a gig, I’m developing a small Postgres extension, adding a few data types and some functions (some of them written in C and some of them written in plpython3). Now, my client doesn’t want the source code to be visible and/or open even internally to other teams; They just want a bunch

Additional accessors via the Extension API ?

2022-02-19 Thread Markur Sens
Suppose I have defined an additional type in a PG extension. Is it possible to add custom accessors to that type -much like jsonb does- but use an API/hook without touching the core PG grammar & parser? Hypothetical Examples: Assuming I have a TextFile type I’d like to implement syntax like:

Re: Additional accessors via the Extension API ?

2022-02-20 Thread Markur Sens
> On 20 Feb 2022, at 12:12 PM, Julien Rouhaud wrote: > > Hi, > > On Sun, Feb 20, 2022 at 08:07:20AM +0200, Markur Sens wrote: >> Suppose I have defined an additional type in a PG extension. >> >> Is it possible to add custom accessors to that type -much l

Re: Additional accessors via the Extension API ?

2022-02-20 Thread Markur Sens
> On 20 Feb 2022, at 12:35 PM, Julien Rouhaud wrote: > > On Sun, Feb 20, 2022 at 12:31:22PM +0200, Markur Sens wrote: >>> >>> Maybe you could rely on some old grammar hack to have something a bit >>> similar, >>> as (expr).funcname is an alias