Re: Postgrest over foreign data wrapper

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: adrien ruffie <adriennolarsen(at)hotmail(dot)fr>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Postgrest over foreign data wrapper
Date: 2019-02-13 18:49:59
Message-ID: CADK3HHJ-tpiNXAfCaHs9Rcmx=kSW5s796ScxDBBQ1Sjo3httYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Hello Adrien,

I expect this should go to pgsql-general. This is not specific to JDBC.

Dave Cramer

davec(at)postgresintl(dot)com
www.postgresintl.com

On Wed, 13 Feb 2019 at 09:13, adrien ruffie <adriennolarsen(at)hotmail(dot)fr>
wrote:

> Hello all,
>
> we have a tricky problem with my colleague.
> We have to database db1 and db2 linked by a foreign data wrapper
> connection.
> 1 table "contractline" in db1 and "contract" in db2.
>
> We use postgrest in order to request db2 via CURL.
> But we want to add a link between previous tables.
>
> In db2 we have a foreign table ft_contractline
> example:
>
> Column | Type | Collation | Nullable | Default
> | FDW options | Storage | Stats target | Description
>
> --------------+--------------------------+-----------+----------+---------+-------------+----------+--------------+-------------
> id | character varying(1024) | | not null |
> | | extended | |
> ccode | text | | | |
> | extended | |
> status | text | | |
> | | extended | |
>
> We want to add for example, the following constraint:
> ALTER TABLE contract ADD CONSTRAINT contractline_ft_contract_fkey FOREIGN
> KEY (contractid) REFERENCES ft_contractline(ccode);
>
> in order to use the following query (via CURL on db2):
> SELECT c.name, c.id FROM contract c JOIN ft_contractline ft_c ON c.id =
> ft_c.ccode WHERE c.type = 'business'
>
> but we saw, isn't possible to add a foreign key on 'contract' table of db2
> to 'ft_contractline' foreign table ...
>
> Do you know way to do it ?
>
> Thank all and best regards.
>
> Adrien
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-02-13 20:25:55 Re: Subquery to select max(date) value
Previous Message Rich Shepard 2019-02-13 18:09:51 Re: Subquery to select max(date) value

Browse pgsql-jdbc by date

  From Date Subject
Next Message adrien ruffie 2019-02-13 21:04:17 Postgrest over foreign data wrapper
Previous Message adrien ruffie 2019-02-13 14:13:21 Postgrest over foreign data wrapper