Re: Use Dblink without column defination

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Chirag Karkera <chiragkrkr102(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Use Dblink without column defination
Date: 2022-05-24 14:10:36
Message-ID: c942aea1-30c1-60c7-23ef-160e756e608b@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23.05.22 10:16, Chirag Karkera wrote:
> mesods=> select * from dblink('foreign_server','select * from
> ods_sch.emp') AS x(a int,b text);
>
>  a |    b
>
> ---+---------
>
>  1 | Gohan
>
>  1 | Piccolo
>
>  1 | Tien
>
> (3 rows)
>
> This works fine when I specify which columns I want to select.
>
> Is there something that postgres has without specifying the column names
> we can fetch the data from dblink.

Not in dblink. You could use foreign-data wrappers, which have a
different interface, which you might like better.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-05-24 14:38:22 Re: PostgreSQL 15 Beta 1 release announcement draft
Previous Message Peter Eisentraut 2022-05-24 14:03:27 Re: Expand palloc/pg_malloc API