pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
RES: Error while running restore
2+ messages / 1 participants
[nested] [flat]

* RES: Error while running restore
@ 2021-01-21 17:59  Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
  1 sibling, 0 replies; 2+ messages in thread

From: Márcio Antônio Sepp @ 2021-01-21 17:59 UTC (permalink / raw)
  To: 'Márcio Antônio Sepp' <marcio@zyontecnologia.com.br>; pgsql-general

 

Ops, Server version tested are: 
PostgreSQL 11.5

and

PostgreSQL 13.1

 

In both cases, i’m making dump and restore to the same Server.

 

 

--

Att

Márcio A. Sepp

 

De: Márcio Antônio Sepp [mailto:marcio@zyontecnologia.com.br] 
Enviada em: quinta-feira, 21 de janeiro de 2021 14:53
Para: pgsql-general@postgresql.org
Assunto: Error while running restore

 

 

Hi all,

 

 

I’m getting this error message when try to restore a database :

 

ERROR:  function f_validanumero_cnpj_cpf(character) does not exist

LINE 1: SELECT (f_validanumero_cnpj_cpf(trim(cnpj_cpf)::char)=false)

                ^

HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.

QUERY:  SELECT (f_validanumero_cnpj_cpf(trim(cnpj_cpf)::char)=false)

CONTEXT:  função PL/pgSQL public.f_testacnpjcpf(character) linha 31 em IF

COPY esp_altera_estoque, line 1, column nr_cnpjcpf: "24614011000120"

 

 

The funny is that i’m restoring the database to the same Server.

Steps:

pg_dump dbname > dumpfile

 

Create new database and restoring with:

psql < dumpfile

 

 

Witch making mistakes do am i making? 

 

In this case, the database is small and if I open the dumpfile with a
notepad and split in 2 files and run after other it works fine. 

 

 

--

Att

Márcio A. Sepp

 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* RES: Error while running restore
@ 2021-01-22 17:49  Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
  1 sibling, 0 replies; 2+ messages in thread

From: Márcio Antônio Sepp @ 2021-01-22 17:49 UTC (permalink / raw)
  To: 'Tom Lane' <tgl@sss.pgh.pa.us>; +Cc: pgsql-general

Hi 

> > I’m getting this error message when try to restore a database :
> > ERROR:  function f_validanumero_cnpj_cpf(character) does not exist
> > LINE 1: SELECT (f_validanumero_cnpj_cpf(trim(cnpj_cpf)::char)=false)
> >                 ^
> > HINT:  No function matches the given name and argument types. You might
> need
> > to add explicit type casts.
> > QUERY:  SELECT (f_validanumero_cnpj_cpf(trim(cnpj_cpf)::char)=false)
> > CONTEXT:  função PL/pgSQL public.f_testacnpjcpf(character) linha 31 em IF
> 
> It looks like f_testacnpjcpf() is making unwarranted assumptions about what
> search_path it's invoked under.  You could try schema-qualifying the
> reference to f_validanumero_cnpj_cpf, or adding an explicit "SET
> search_path" clause to f_testacnpjcpf().

Thank you. Setting set search_path to f_testacnpjcpf() works fine. 

Thank you Tom! Thanks list! 







^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-01-22 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 17:59 ` Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
2021-01-22 17:49 ` Márcio Antônio Sepp <marcio@zyontecnologia.com.br>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox