Skip to main content
Solved

PostgreSQL Writer to inherited table


Greetings,

Is writer to PostgreSQL inherited table is supported by FME desktop. It's not working and return error.

Regards,

Maha

Best answer by markatsafe

maha wrote:

Hi Mark,

Thanks for your response.

 

The issue exist at adding new writer to the inherited table.

Inherited table is working correctly with me at querying at database level and at SQLExecuter.

The problem is with writer. while trying to define new writer >> the error generated and writer not added.

You can make a test by adding new writer to the 'capitals' table that you shared it's script >> the error will generated.

 

Regards,

Maha

 

@maha​ sorry - I don't see that error. I'm working with FME 2021.0. What version of FME are you using?

The steps I use are:

  • add Postgresql writer
  • Table Definition: Import from Dataset

It seems to add the 'capitals' table that has the INHERITS ok.

View original
Did this help you find an answer to your question?

6 replies

hkingsbury
Celebrity
Forum|alt.badge.img+50
  • Celebrity
  • June 3, 2021

What is the error being reported?


  • Author
  • June 3, 2021
hkingsbury wrote:

What is the error being reported?

Below is the error while trying to add writer to inherited table:

SOURCE_READER statement must be of the form 'SOURCE_READER <reader type> [<parm> <value>]*' -- `SOURCE_READER POSTGRES SCHEMAS_FOR_TABLE_LISTING us_govserv_ext EXPOSED_ATTRS' is invalid : Row came from between lines 1 and 19 of file C:\\Program Files\\FME\\metafile\\POSTGRES.fmf

Failed to read schema features from dataset 'serag_conn' using the 'POSTGRES' reader


Forum|alt.badge.img+2

@maha​ FME should be able to read a PostgreSQL table that uses INHERITS. I created a very simple example and it seems OK:

CREATE TABLE cities (
    name            text,
    population      float,
    elevation       int     -- in feet
);
CREATE TABLE capitals (
  state      char(2UNIQUE NOT NULL
) INHERITS (cities);
 
INSERT INTO cities VALUES ('surrey'8000.0,10);
INSERT INTO cities VALUES ('vancouver'8000.0,10);
 
INSERT INTO capitals VALUES ('victoria'8000.0,10,'BC');
 

So I suspect the issue is arising elsewhere and not related to the  INHERITS


  • Author
  • June 3, 2021
markatsafe wrote:

@maha​ FME should be able to read a PostgreSQL table that uses INHERITS. I created a very simple example and it seems OK:

CREATE TABLE cities (
    name            text,
    population      float,
    elevation       int     -- in feet
);
CREATE TABLE capitals (
  state      char(2UNIQUE NOT NULL
) INHERITS (cities);
 
INSERT INTO cities VALUES ('surrey'8000.0,10);
INSERT INTO cities VALUES ('vancouver'8000.0,10);
 
INSERT INTO capitals VALUES ('victoria'8000.0,10,'BC');
 

So I suspect the issue is arising elsewhere and not related to the  INHERITS

Hi Mark,

Thanks for your response.

 

The issue exist at adding new writer to the inherited table.

Inherited table is working correctly with me at querying at database level and at SQLExecuter.

The problem is with writer. while trying to define new writer >> the error generated and writer not added.

You can make a test by adding new writer to the 'capitals' table that you shared it's script >> the error will generated.

 

Regards,

Maha

 


Forum|alt.badge.img+2
  • Best Answer
  • June 4, 2021
maha wrote:

Hi Mark,

Thanks for your response.

 

The issue exist at adding new writer to the inherited table.

Inherited table is working correctly with me at querying at database level and at SQLExecuter.

The problem is with writer. while trying to define new writer >> the error generated and writer not added.

You can make a test by adding new writer to the 'capitals' table that you shared it's script >> the error will generated.

 

Regards,

Maha

 

@maha​ sorry - I don't see that error. I'm working with FME 2021.0. What version of FME are you using?

The steps I use are:

  • add Postgresql writer
  • Table Definition: Import from Dataset

It seems to add the 'capitals' table that has the INHERITS ok.


  • Author
  • June 4, 2021
maha wrote:

Hi Mark,

Thanks for your response.

 

The issue exist at adding new writer to the inherited table.

Inherited table is working correctly with me at querying at database level and at SQLExecuter.

The problem is with writer. while trying to define new writer >> the error generated and writer not added.

You can make a test by adding new writer to the 'capitals' table that you shared it's script >> the error will generated.

 

Regards,

Maha

 

Hi Mark,

Thanks so much. I think the problem was version. it's working correctly now

Regards,

Maha


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings