postgres_fdw foreign tables and serial columns

From: "Nicholson, Brad (Toronto, ON, CA)" <bnicholson(at)hp(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: postgres_fdw foreign tables and serial columns
Date: 2013-05-15 12:15:54
Message-ID: EC55DC235432104F8255702A8D7344D9418B5F0D@G4W3302.americas.hpqcorp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm kicking the tires on the 9.3 postgres_fdw stuff - I'm not sure if this is an issue or intended behavior, but it was pretty confusing based on the error message that was output. If you try creating a foreign table with a reference to a serial data type, it comes back with a "referenced relation is not a table" error. If you change the data type in the referenced table to integer - then it works. Completely understand why this is needed - but it tripped me up for a while. At the very least, can I suggest adding something in the documentation about serial columns (if it is not an issue)?

test=# create table foo (id serial);
CREATE TABLE

test=# create foreign table local_foo (id serial) server test_server options (table_name 'foo');
ERROR: referenced relation "local_foo" is not a table

test=# create foreign table local_foo (id integer) server test_server options (table_name 'foo');
CREATE FOREIGN TABLE

Brad

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Powers 2013-05-15 12:42:07 Re: streaming replication, "frozen snapshot backup on it" and missing relfile (postgres 9.2.3 on xfs + LVM)
Previous Message Pavel Stehule 2013-05-15 11:08:55 Re: Proposed TODO: add support for "any" for PL/PythonU and PL/Perl