Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create partition if schema name contains '.' #447

Closed
divyaJainPhilips opened this issue Mar 24, 2022 · 4 comments
Closed

Not able to create partition if schema name contains '.' #447

divyaJainPhilips opened this issue Mar 24, 2022 · 4 comments
Assignees
Labels

Comments

@divyaJainPhilips
Copy link

Hi ,
I have a schema with name Aa.Bb.Cc
Schema name is Case Sensitive and has . in it
when i am trying to use create_parent function using
SELECT create_parent('"Aa.Bb.Cc".time_taptest_table', 'col3', 'native', 'hourly', p_template_table := '"Aa.Bb.Cc".time_taptest_table_template');
getting below error
ERROR: Unable to find given parent table in system catalogs. Please create parent table first: "Aa.Bb.Cc".time_taptest_table
CONTEXT: PL/pgSQL function create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean) line 85 at RAISE
DETAIL:
HINT:
CONTEXT: PL/pgSQL function create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean) line 771 at RAISE
SQL state: P000

Any suggestions on how to fix it

@keithf4
Copy link
Collaborator

keithf4 commented Mar 24, 2022

I don't believe you need to put the schema name in double-quotes for the arguments to the function. Try just doing

SELECT create_parent('Aa.Bb.Cc.time_taptest_table', 'col3', 'native', 'hourly', p_template_table := 'Aa.Bb.Cc.time_taptest_table_template');

@keithf4 keithf4 self-assigned this Mar 24, 2022
@divyaJainPhilips
Copy link
Author

same error even after removing double-quotes
ERROR: Unable to find given parent table in system catalogs. Please create parent table first: Aa.Bb.Cc.time_taptest_table
CONTEXT: PL/pgSQL function create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean) line 85 at RAISE
DETAIL:
HINT:
CONTEXT: PL/pgSQL function create_parent(text,text,text,text,text[],integer,text,text,boolean,text,text,text[],boolean,text,boolean) line 771 at RAISE
SQL state: P0001

@keithf4
Copy link
Collaborator

keithf4 commented Mar 24, 2022

So this is going to be a difficult one to fix support for in the near future. The code pretty extensively makes use of split_part(string, '.') to try and split the schema name from the table name.

If there's any chance of eliminating the period in your object naming patterns, I would recommend it. While it's technically supported, it's a very confusing naming pattern in a system that uses them for namespace distinction.

@keithf4
Copy link
Collaborator

keithf4 commented Apr 27, 2022

Changing this to won't fix at this time. Can revisit this if it becomes a persistent problem, but as I said, using periods in object naming seems like an antipattern in PostgreSQL at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants