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

* Error while running restore
@ 2021-01-21 17:52 Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
  2021-01-21 18:41 ` Re: Error while running restore Tom Lane <tgl@sss.pgh.pa.us>
  2021-01-21 21:00 ` Re: Error while running restore Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Márcio Antônio Sepp @ 2021-01-21 17:52 UTC (permalink / raw)
  To: pgsql-general

 

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] 3+ messages in thread

* Re: Error while running restore
  2021-01-21 17:52 Error while running restore Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
@ 2021-01-21 18:41 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-01-21 18:41 UTC (permalink / raw)
  To: Márcio Antônio Sepp <marcio@zyontecnologia.com.br>; +Cc: pgsql-general

=?iso-8859-1?Q?M=E1rcio_Ant=F4nio_Sepp?= <marcio@zyontecnologia.com.br> writes:
> 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().

			regards, tom lane





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

* Re: Error while running restore
  2021-01-21 17:52 Error while running restore Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
@ 2021-01-21 21:00 ` Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 0 replies; 3+ messages in thread

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

On 1/21/21 9:52 AM, Márcio Antônio Sepp wrote:
> 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.

Split where?

Is this function being used in a TRIGGER on esp_altera_estoque?

> 
> --
> 
> Att
> 
> Márcio A. Sepp
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





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


end of thread, other threads:[~2021-01-21 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 17:52 Error while running restore Márcio Antônio Sepp <marcio@zyontecnologia.com.br>
2021-01-21 18:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-01-21 21:00 ` Adrian Klaver <adrian.klaver@aklaver.com>

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