pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Unable to create function via psql
9+ messages / 3 participants
[nested] [flat]

* Unable to create function via psql
@ 2011-03-07 08:17 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 9+ messages in thread

From: Lukasz Brodziak @ 2011-03-07 08:17 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have a problem with creating function through script ran in psql.
I'm running the script AdminPack.sql from the contrib package using
this statement:
sudo su postgres -c psql MyDB < /usr/share/postgresql/8.2/contrib/adminpack.sql

Script performs without problem yet when I log into my software I get
the error that pg_file_lenght does not exists. Opening the script in
pgAdmin and hitting F5 creates the function and enables logging into
the program without error. Can anyone help me with running the script
correctly through shell.
-- 
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2011-03-07 09:31 ` Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Guillaume Lelarge @ 2011-03-07 09:31 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: pgsql-admin

Le 07/03/2011 09:17, Lukasz Brodziak a écrit :
> Hello,
> 
> I have a problem with creating function through script ran in psql.
> I'm running the script AdminPack.sql from the contrib package using
> this statement:
> sudo su postgres -c psql MyDB < /usr/share/postgresql/8.2/contrib/adminpack.sql
> 
> Script performs without problem yet when I log into my software I get
> the error that pg_file_lenght does not exists. Opening the script in
> pgAdmin and hitting F5 creates the function and enables logging into
> the program without error. Can anyone help me with running the script
> correctly through shell.

You need to execute the script in the postgres database, not the MyDB
database.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
@ 2011-03-07 10:39   ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 9+ messages in thread

From: Lukasz Brodziak @ 2011-03-07 10:39 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin

I still have the same error. Is there any other way of running the
script outside pgAdmin?

2011/3/7 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 07/03/2011 09:17, Lukasz Brodziak a écrit :
>> Hello,
>>
>> I have a problem with creating function through script ran in psql.
>> I'm running the script AdminPack.sql from the contrib package using
>> this statement:
>> sudo su postgres -c psql MyDB < /usr/share/postgresql/8.2/contrib/adminpack.sql
>>
>> Script performs without problem yet when I log into my software I get
>> the error that pg_file_lenght does not exists. Opening the script in
>> pgAdmin and hitting F5 creates the function and enables logging into
>> the program without error. Can anyone help me with running the script
>> correctly through shell.
>
> You need to execute the script in the postgres database, not the MyDB
> database.
>
>
> --
> Guillaume
>  http://www.postgresql.fr
>  http://dalibo.com
>



-- 
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2011-03-07 10:45     ` Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:54       ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Guillaume Lelarge @ 2011-03-07 10:45 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: pgsql-admin

Le 07/03/2011 11:39, Lukasz Brodziak a écrit :
> I still have the same error. Is there any other way of running the
> script outside pgAdmin?
> 

Can you give us the real error message you get?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
@ 2011-03-07 10:54       ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 11:05         ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 9+ messages in thread

From: Lukasz Brodziak @ 2011-03-07 10:54 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin

Here it is: http://img69.imageshack.us/i/errorjn.png/

Again, when I perform AdminPack.sql in pgAdmin I don't get the error.

2011/3/7 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 07/03/2011 11:39, Lukasz Brodziak a écrit :
>> I still have the same error. Is there any other way of running the
>> script outside pgAdmin?
>>
>
> Can you give us the real error message you get?
>
>
> --
> Guillaume
>  http://www.postgresql.fr
>  http://dalibo.com
>



-- 
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:54       ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2011-03-07 11:05         ` Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 11:55           ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Guillaume Lelarge @ 2011-03-07 11:05 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: pgsql-admin

Le 07/03/2011 11:54, Lukasz Brodziak a écrit :
> Here it is: http://img69.imageshack.us/i/errorjn.png/
> 
> Again, when I perform AdminPack.sql in pgAdmin I don't get the error.
> 

You don't do the same thing. If "performing" adminpack.sql is executing
it, you also don't have an error with psql when you execute it. At
least, the error message displayed has nothing to do with executing the
adminpack SQL script.

To get back to your error message, it simply says that the
pg_file_length(text) function doesn't exist in the database your tool is
connected too. So, first, you need to make sure that your tool connects
to the database where you added the functions (IOW, where you executed
the adminpack script).


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:54       ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 11:05         ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
@ 2011-03-07 11:55           ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 15:04             ` Re: Unable to create function via psql Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 9+ messages in thread

From: Lukasz Brodziak @ 2011-03-07 11:55 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin

Yes. The only DBs on the server are both templates, postgres and MyDB.
Still don't why the problem with the function occurs only when the
script is ran through psql and not through pgAdmin.

2011/3/7 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 07/03/2011 11:54, Lukasz Brodziak a écrit :
>> Here it is: http://img69.imageshack.us/i/errorjn.png/
>>
>> Again, when I perform AdminPack.sql in pgAdmin I don't get the error.
>>
>
> You don't do the same thing. If "performing" adminpack.sql is executing
> it, you also don't have an error with psql when you execute it. At
> least, the error message displayed has nothing to do with executing the
> adminpack SQL script.
>
> To get back to your error message, it simply says that the
> pg_file_length(text) function doesn't exist in the database your tool is
> connected too. So, first, you need to make sure that your tool connects
> to the database where you added the functions (IOW, where you executed
> the adminpack script).
>
>
> --
> Guillaume
>  http://www.postgresql.fr
>  http://dalibo.com
>



-- 
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:54       ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 11:05         ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 11:55           ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2011-03-07 15:04             ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2011-03-08 15:27               ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Kevin Grittner @ 2011-03-07 15:04 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin

Lukasz Brodziak <lukasz.brodziak@gmail.com> wrote:
 
> Still don't why the problem with the function occurs only when the
> script is ran through psql and not through pgAdmin.
 
It would help if you could provide a self-contained psql test script
which demonstrates the problem.  If the function is large, it would
be good to pare it down to the smallest function which still shows
the problem.
 
-Kevin



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

* Re: Unable to create function via psql
  2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 09:31 ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:39   ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 10:45     ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 10:54       ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 11:05         ` Re: Unable to create function via psql Guillaume Lelarge <guillaume@lelarge.info>
  2011-03-07 11:55           ` Re: Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2011-03-07 15:04             ` Re: Unable to create function via psql Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2011-03-08 15:27               ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Lukasz Brodziak @ 2011-03-08 15:27 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: Guillaume Lelarge <guillaume@lelarge.info>; pgsql-admin

Ok problem solved.
I managed to get through this using remote connection from Windows
machine using: psql -h 192.168.1.10 -U postgres -d MyDB <
C:\adminpack.sql command

Thank You all for You help and input on this subject.

2011/3/7 Kevin Grittner <Kevin.Grittner@wicourts.gov>:
> Lukasz Brodziak <lukasz.brodziak@gmail.com> wrote:
>
>> Still don't why the problem with the function occurs only when the
>> script is ran through psql and not through pgAdmin.
>
> It would help if you could provide a self-contained psql test script
> which demonstrates the problem.  If the function is large, it would
> be good to pare it down to the smallest function which still shows
> the problem.
>
> -Kevin
>



-- 
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"



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


end of thread, other threads:[~2011-03-08 15:27 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 08:17 Unable to create function via psql Lukasz Brodziak <lukasz.brodziak@gmail.com>
2011-03-07 09:31 ` Guillaume Lelarge <guillaume@lelarge.info>
2011-03-07 10:39   ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
2011-03-07 10:45     ` Guillaume Lelarge <guillaume@lelarge.info>
2011-03-07 10:54       ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
2011-03-07 11:05         ` Guillaume Lelarge <guillaume@lelarge.info>
2011-03-07 11:55           ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
2011-03-07 15:04             ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2011-03-08 15:27               ` Lukasz Brodziak <lukasz.brodziak@gmail.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