postgres_fdw foreign tables and serial columns - Mailing list pgsql-hackers

From Nicholson, Brad (Toronto, ON, CA)
Subject postgres_fdw foreign tables and serial columns
Date
Msg-id EC55DC235432104F8255702A8D7344D9418B5F0D@G4W3302.americas.hpqcorp.net
Whole thread Raw
Responses Re: postgres_fdw foreign tables and serial columns  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
prettyconfusing based on the error message that was output.  If you try creating a foreign table with a reference to a
serialdata type, it comes back with a "referenced relation is not a table" error.  If you change the data type in the
referencedtable 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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Proposed TODO: add support for "any" for PL/PythonU and PL/Perl
Next
From: Amit Langote
Date:
Subject: Re: Logging of PAM Authentication Failure