[SQL] PQendcopy: resetting connection error

2000-11-23 Thread sathya priya

hai,

 I encountered the following error While I was trying
to pg_dump the database using the command

  pg_dump -z dbname > bkfilename


PQendcopy: resetting connection
SQL query to dump the contents of Table 'sarehits' did
not execute correctly.  A
fter we read all the table contents from the backend,
PQendcopy() failed.  Expla
nation from backend: ''.
The query was: 'COPY "sarehits" TO stdout;
'.



any help to solve the above said problem.


with regds
p. ashok kumar


__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



[SQL]

2000-11-23 Thread turing2000

Sorry for my previos letter, it was wrong.

Deal ( question ) are consist of:

[plperl]# make
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/plperl
mkdir blib/lib/auto
mkdir blib/lib/auto/plperl
gcc -c -I../../../src/include -I../../../src/backend  -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.10\" 
-DXS_VERSION=\"0.10\" -fpic -I/usr/local/perl/lib/5.6.0/i686-linux/CORE  plperl.c
In file included from plperl.c:76:
/usr/local/perl/lib/5.6.0/i686-linux/CORE/perl.h:467: warning: `USE_LOCALE' redefined
../../../src/include/config.h:214: warning: this is the location of the previous 
definition
In file included from plperl.c:76:
/usr/local/perl/lib/5.6.0/i686-linux/CORE/perl.h:2027: warning: `DEBUG' redefined
../../../src/include/utils/elog.h:22: warning: this is the location of the previous 
definition
plperl.c: In function `plperl_create_sub':
plperl.c:328: `errgv' undeclared (first use in this function)
plperl.c:328: (Each undeclared identifier is reported only once
plperl.c:328: for each function it appears in.)
plperl.c:334: `na' undeclared (first use in this function)
plperl.c: In function `plperl_call_perl_func':
plperl.c:444: `errgv' undeclared (first use in this function)
plperl.c:450: `na' undeclared (first use in this function)
plperl.c: In function `plperl_func_handler':
plperl.c:654: `na' undeclared (first use in this function)
plperl.c: In function `plperl_build_tuple_argument':
plperl.c:2192: `na' undeclared (first use in this function)
make: *** [plperl.o] Error 1

What's that may be?
  
  turing2000




[SQL]

2000-11-23 Thread Farfán

ello there,
 I'm looking for a (free, shareware) SQL parser and I
haven't had much
luck. I was wandering whether it's feasible to get
postgresql and
"separate" the parser from the rest of the code and
use it
stand-alone. Any experience, suggestions or comments,
please e-mail
them to: [EMAIL PROTECTED] I don't follow this
mailing list.
 Thanks in advance for your help,
Luis Jorge Farfán
Computer Science and Computer Engineering
ITESM 

P.S. If anyone can think of an easier way to get an
SQL parser, I'd love
to hear it.



__
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/



[SQL]

2000-11-23 Thread turing2000

Please, help me.
I configure/compile perl with option ( other options stay default ):

./Configure -Dprefix=/usr/local/perl -Duseshrplib
make
make install

I add string '/usr/local/perl/lib/5.6.0/i686-linux/CORE' 
in file /etc/ld.so.conf and call program 'ldconfig'.

Environment: 
LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/perl/lib/5.6.0/i686-linux/CORE

All is OK for perl. But in psql:

\c db_name

create function perl_hnd() returns opaque as'
/usr/local/perl/lib/5.6.0/i686-linux/CORE/libperl.so' language 'C';

create trusted procedural language 'perl' 
handler perl_hnd lancompiler 'perlcompiler';

create function f( int4, int4 ) returns int4 as'
return $_[0] + $_[1]; 'language 'perl';

db_name=> select f(2,2);
ERROR:  Can't find function perl_hnd in file 
/usr/local/perl/lib/5.6.0/i686-linux/CORE/libperl.so

Please, help me!
  
  turing2000




[SQL] is there a debian package for plperl?

2000-11-23 Thread Bruno Boettcher

Hello,
subject says it all, wanted to give plperl a try, but the lib doesn't
seem installed... now i installed all through debian packaging system,
and the lib surely is somewhere, but i didn't found it yet...

so i anybody could point on on where to search for it...

-- 
ciao bboett
==
[EMAIL PROTECTED]
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===
the total amount of intelligence on earth is constant.
human population is growing



[SQL] Statement too long

2000-11-23 Thread Yves Martin


Hello,

   I have some problem with too long statement.
  In 'psql', the error returned for my insert statement is
ERROR: Tuple is too big: size 10436

  In fact, I use JDBC driver to insert a long long string into a 'text'
  field. The exception is

The SQL Statement is too long - INSERT INTO TRIGGERQUEUE   (DUETIME,
TYPE, EVENT, ACTION) VALUES( 974992122555, 'CONTAINER', 
.(long really long)...

  So is it possible to re-build postmaster to avoid this limitation for
  too long statement or is there another way in JDBC ?

  Another problem is that with jdbc 6.5 and 7.0 the example of using largeobject
  in postgreSQL development corner site does not work. It returns an exception:
  setBinaryStream does not support an input as an InputStream.
  So how to make this exemple work ?

 Regards
  
-- 
Yves Martin
yma, Lausanne




[SQL] Help with displaying data types.

2000-11-23 Thread Rob Burne

I am trying to perform a query that will:

1. Return all user defined attributes from a relation.

2. Also return the datatypes of each relation.

So far I can only achieve part 1 with the following:

select attname from pg_class,pg_attribute
where relname=relation_name and
attrelid = pg_class.oid and
atttypid != 26 and
atttypid != 27 and
atttypid != 28 and
atttypid != 29;

But what do I need to add to return the datatype of each attribute. Any 
suggestions please?

Regards,

Rob.
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.




[SQL] Create tables in one query

2000-11-23 Thread Tomasz Gralewski

Hello,
Tomasz Gralewski

I'd like to create a few tables in one SQL query, is that possible.
What tools I have to use, Perl, Tcl, or maybe is there block command
separator that I can write:
CREATE TABLE abd
 (
atype,
btype,
ctype
 ) and I whant to add the next table here, how can I separate, by this (";"
that;s the end of table abd).

Thank You in advance.
Tomasz




[SQL] Selecting data from other database.

2000-11-23 Thread Ronnie Rap

Help,

Does someone know how to get data from an other database using a select
statement?

In sybase I could use select * from otherdatabase..table;

But with PostgreSQL I haven't found a way yet to do this.

T.i.a
Ronnie




[SQL] Re: is there a mysql to postgresql sql converter?

2000-11-23 Thread Clayton Cottingham


On Sat, 18 Nov 2000 01:13:23 +0200, Max Fonin said:

> Can give a link ?
>  

can do :
http://freshmeat.net/projects/mysql2pgsql/?highlight=convert+sql

i havent tried their's

did try yours

it was nice to have the transactions!



>  On Fri, 17 Nov 2000 13:45:37 -0800
>  clayton cottingham <[EMAIL PROTECTED]> wrote:
>  
>  > Max Fonin wrote:
>  > > 
>  > > Hi.
>  > > 
>  > > I'm writing MySQL->Postgres dump converter. E.g. it will convert only database 
>dumps produced by mysqldump.
>  > > It's almost ready, problems are ENUM and SET types. I have problems with types 
>emulation.
>  > > Maybe someone help me guys ?
>  > > 
>  > > Anyway, some half-working version attached.
>  > > 
>  > > Max Rudensky.
>  > > 
>  > >   
>  > >Name: my2pg.pl
>  > >my2pg.plType: Perl Program (application/x-perl)
>  > >Encoding: base64
>  > 
>  > 
>  > thats cool!!
>  > 
>  > i thought i saw another converter in the last couple o months on
>  > freshmeat too
>  
>  




Re: [SQL]

2000-11-23 Thread Joel Mc Graw

"Luis Farfán" wrote:
> 
> ello there,
>  I'm looking for a (free, shareware) SQL parser and I
> haven't had much
> luck. I was wandering whether it's feasible to get
> postgresql and
> "separate" the parser from the rest of the code and
> use it
> stand-alone. Any experience, suggestions or comments,
> please e-mail
> them to: [EMAIL PROTECTED] I don't follow this
> mailing list.
>  Thanks in advance for your help,
> Luis Jorge Farfán
> Computer Science and Computer Engineering
> ITESM
> 
> P.S. If anyone can think of an easier way to get an
> SQL parser, I'd love
> to hear it.

Just a thought:

Gadfly is a free SQL database implemented in pure Python. The following
link lists the Python modules for the SQL engine:

http://www.chordate.com/kwParsing/index.html

Hope that helps



Re: [SQL] Help with displaying data types.

2000-11-23 Thread Tom Lane

"Rob Burne" <[EMAIL PROTECTED]> writes:
> I am trying to perform a query that will:
> 1. Return all user defined attributes from a relation.
> 2. Also return the datatypes of each relation.

> So far I can only achieve part 1 with the following:

> select attname from pg_class,pg_attribute
> where relname=relation_name and
> attrelid = pg_class.oid and
> atttypid != 26 and
> atttypid != 27 and
> atttypid != 28 and
> atttypid != 29;

That's a bad way to do it, because your query will drop user-defined
columns of type OID (among others).  I'd suggest testing for attnum > 0
to get rid of system columns.

> But what do I need to add to return the datatype of each attribute. Any 
> suggestions please?

Join against pg_type.  For example,

select attname, typname
from pg_class c, pg_attribute a, pg_type t
where relname = relation_name and
attrelid = c.oid and
atttypid = t.oid and
attnum > 0
order by attnum;

psql does a lot of these sorts of queries for its \d features.
Try starting psql with -E so you can see what queries it issues
when you do a \d ...

regards, tom lane



Re: [SQL] Create tables in one query

2000-11-23 Thread bmccoy

On Thu, 23 Nov 2000, Tomasz Gralewski wrote:

> I'd like to create a few tables in one SQL query, is that possible.
> What tools I have to use, Perl, Tcl, or maybe is there block command
> separator that I can write:
> CREATE TABLE abd
>  (
> atype,
> btype,
> ctype
>  ) and I whant to add the next table here, how can I separate, by this (";"
> that;s the end of table abd).

Not sure what you are trying to do here.  You can put statements like

CREATE TABLE (
...
);

CREATE TABLE (
...
);

CREATE INDEX ... ;
GRANT SELECT... ;

in a single file and load the file into psql via \i.  That's I build all
of my databases.

Brett W. McCoy
 http://www.chapelperilous.net/~bmccoy/
---
A bachelor is a selfish, undeserving guy who has cheated some woman out
of a divorce.
-- Don Quinn




[SQL] Re: is there a mysql to postgresql sql converter?

2000-11-23 Thread Max Fonin

Hi.

I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps 
produced by mysqldump.
It's almost ready, problems are ENUM and SET types. I have problems with types 
emulation.
Maybe someone help me guys ?

Anyway, some half-working version attached.

Max Rudensky.

 my2pg.pl


[SQL] Re: is there a mysql to postgresql sql converter?

2000-11-23 Thread Max Fonin

Can give a link ?

On Fri, 17 Nov 2000 13:45:37 -0800
clayton cottingham <[EMAIL PROTECTED]> wrote:

> Max Fonin wrote:
> > 
> > Hi.
> > 
> > I'm writing MySQL->Postgres dump converter. E.g. it will convert only database 
>dumps produced by mysqldump.
> > It's almost ready, problems are ENUM and SET types. I have problems with types 
>emulation.
> > Maybe someone help me guys ?
> > 
> > Anyway, some half-working version attached.
> > 
> > Max Rudensky.
> > 
> >   
> >Name: my2pg.pl
> >my2pg.plType: Perl Program (application/x-perl)
> >Encoding: base64
> 
> 
> thats cool!!
> 
> i thought i saw another converter in the last couple o months on
> freshmeat too



[SQL] Re: is there a mysql to postgresql sql converter?

2000-11-23 Thread clayton cottingham

Max Fonin wrote:
> 
> Hi.
> 
> I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps 
>produced by mysqldump.
> It's almost ready, problems are ENUM and SET types. I have problems with types 
>emulation.
> Maybe someone help me guys ?
> 
> Anyway, some half-working version attached.
> 
> Max Rudensky.
> 
>   
>Name: my2pg.pl
>my2pg.plType: Perl Program (application/x-perl)
>Encoding: base64


thats cool!!

i thought i saw another converter in the last couple o months on
freshmeat too



[SQL] Re: is there a mysql to postgresql sql converter?

2000-11-23 Thread Max Fonin

Hi.

> > Can give a link ?
> can do :
> http://freshmeat.net/projects/mysql2pgsql/?highlight=convert+sql
Thank you.

BTW, if you interested in this tool, I may send you fresh versions or place it on the 
web.

Maybe you will or somebody help me with one problem ? Do you know PL/pgSQL and how to 
create new type in Postgres ?
The problem is that I can't use new type constructed with CREATE TYPE if transform 
functions written on PL/pgSQL.
Because PL/pgSQL doesn't support type "opaque", or I do something wrong. The same 
function on PL/pgSQL with 
input argtype "text" or "int2" works fine, but when I simply change argtype to 
"opaque", I get "compilation error near line 0".
Source is below.

Thanks,
Max Rudensky.

BEGIN;

CREATE FUNCTION enum_access_Monday_in (opaque)
RETURNS enum_access_Monday
AS '
DECLARE
invalue ALIAS for $1;
BEGIN
IF invalue= OR invalue=''0'' THEN RETURN 0; END IF;
IF invalue=''Monday'' OR invalue=''1'' THEN RETURN 1; END IF;
IF invalue=''Tuesday'' OR invalue=''2'' THEN RETURN 2; END IF;
IF invalue=''Wednesday'' OR invalue=''3'' THEN RETURN 3; END IF;
RAISE EXCEPTION ''incorrect input value: %'',invalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);
CREATE FUNCTION enum_access_Monday_out (opaque)
RETURNS opaque
AS '
DECLARE
outvalue ALIAS for $1;
BEGIN
IF outvalue=0 THEN RETURN ; END IF;
IF outvalue=1 THEN RETURN ''Monday''; END IF;
IF outvalue=2 THEN RETURN ''Tuesday''; END IF;
IF outvalue=3 THEN RETURN ''Wednesday''; END IF;
RAISE EXCEPTION ''incorrect output value: %'',outvalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);

CREATE TYPE enum_access_Monday (
internallength = 2,
input = enum_access_Monday_in,
output = enum_access_Monday_out,
PASSEDBYVALUE
);

COMMIT;



[SQL] newbie: execute an sql script

2000-11-23 Thread j . uy

hi everyone,
just wanna ask how I could execute an sql script to feed into the
database?

Jess Emerson Uy
[EMAIL PROTECTED]




[SQL] psql question

2000-11-23 Thread Joe Conway

Hello,

I've been searching off-and-on for an answer to this question, but I haven't
found anything but fleeting references.

Here's the problem/question:

On machines where I've installed PostgreSQL 7.0.2 from RPM, psql allows use
of the up arrow key for history and the escape/tab key for command
completion, but on my remote web host (webpipe.net) those keys don't work.
What do I need to do to get these features working on my remote web host?
I've seen reference to .psqlrc in the psql man file, but not much else (no
syntax, etc).

Thanks in advance!

Joe





[SQL]

2000-11-23 Thread Sean Weissensee



Why does this error come up
 
 ionsol=> update quickstock set ItemDesc = 
'1',Qty = 0.0,salesprice = 0.0 where StockID = '8597' \gERROR:  
Relation 'quickstock' does not have attribute 'itemdesc'   

 
when ItemDesc does exist.
 
Sean


Re: [SQL] psql question

2000-11-23 Thread Mathijs Brands

On Thu, Nov 23, 2000 at 07:31:36PM +0100, Peter Eisentraut allegedly wrote:
> Joe Conway writes:
> 
> > On machines where I've installed PostgreSQL 7.0.2 from RPM, psql allows use
> > of the up arrow key for history and the escape/tab key for command
> > completion, but on my remote web host (webpipe.net) those keys don't work.
> > What do I need to do to get these features working on my remote web host?
> > I've seen reference to .psqlrc in the psql man file, but not much else (no
> > syntax, etc).
> 
> If you compiled from source, make sure you had the readline-devel package
> installed.

Also, check the version of the psql shell. 6.x won't do a lot of those neat
little things that make life easier in 7.x.

Mathijs
-- 
It's not that perl programmers are idiots, it's that the language
rewards idiotic behavior in a way that no other language or tool has
ever done.
Erik Naggum



Re: [SQL]

2000-11-23 Thread Ross J. Reedstrom

On Mon, Nov 20, 2000 at 01:24:32PM +1000, Sean Weissensee wrote:
> Why does this error come up
> 
>  ionsol=> update quickstock set ItemDesc = '1',Qty = 0.0,salesprice = 0
> .0 where StockID = '8597' \g
> ERROR:  Relation 'quickstock' does not have attribute 'itemdesc'   
> 
> when ItemDesc does exist.


Because SQL is case insensitive, by default. Postgresql implements this by
downcasing all identifiers (table and column names) unless quoted with
double quotes. I'm guessing that you created this table via MS-Access. The
ODBC driver quotes identifiers by default.

Try this:

update quickstock set "ItemDesc" = '1',"Qty" = 0.0,salesprice =
0.0 where "StockID" = '8597' \g

Ross
-- 
Open source code is like a natural resource, it's the result of providing
food and sunshine to programmers, and then staying out of their way.
[...] [It] is not going away because it has utility for both the developers 
and users independent of economic motivations.  Jim Flynn, Sunnyvale, Calif.



Re: [SQL] psql question

2000-11-23 Thread Joe Conway

> > On machines where I've installed PostgreSQL 7.0.2 from RPM, psql allows
use
> > of the up arrow key for history and the escape/tab key for command
> > completion, but on my remote web host (webpipe.net) those keys don't
work.
> > What do I need to do to get these features working on my remote web
host?
> > I've seen reference to .psqlrc in the psql man file, but not much else
(no
> > syntax, etc).
>
> If you compiled from source, make sure you had the readline-devel package
> installed.
>

Thanks for your responses, Peter & Mathijs.

Actually, since the issue is on a hosted system, I don't have access to
recompile. I was hoping that maybe there would be something I could
configure from my own (non-root and non-postgres) account.

My question actaully took several days just to make it to the list, so in
the meantime I found my own work-around -- I copied local copies of psql and
libpq up to my account on the web host. Then I put my own account folder to
the front of the PATH and added a LD_LIBRARY_PATH. Now when I run 'psql' it
works just like on my own machine!

Thanks again for the response.

Joe





Re: [SQL] psql question

2000-11-23 Thread clayton cottingham

Joe Conway wrote:
> 
> > > On machines where I've installed PostgreSQL 7.0.2 from RPM, psql allows
> use
> > > of the up arrow key for history and the escape/tab key for command
> > > completion, but on my remote web host (webpipe.net) those keys don't
> work.
> > > What do I need to do to get these features working on my remote web
> host?
> > > I've seen reference to .psqlrc in the psql man file, but not much else
> (no
> > > syntax, etc).
> >
> > If you compiled from source, make sure you had the readline-devel package
> > installed.
> >
> 
> Thanks for your responses, Peter & Mathijs.
> 
> Actually, since the issue is on a hosted system, I don't have access to
> recompile. I was hoping that maybe there would be something I could
> configure from my own (non-root and non-postgres) account.
> 
> My question actaully took several days just to make it to the list, so in
> the meantime I found my own work-around -- I copied local copies of psql and
> libpq up to my account on the web host. Then I put my own account folder to
> the front of the PATH and added a LD_LIBRARY_PATH. Now when I run 'psql' it
> works just like on my own machine!
> 
> Thanks again for the response.
> 
> Joe


you could use a version of pgsql on your own machine and use the host
switch to connect to an extrenal db

of course your db isp will have to allow your ip to connect, not an easy
thing if your dial up!!


this way you could recompile your own ver of psql

hope that helps



Re: [SQL] psql question

2000-11-23 Thread bmccoy

On Sun, 19 Nov 2000, Joe Conway wrote:

> On machines where I've installed PostgreSQL 7.0.2 from RPM, psql allows use
> of the up arrow key for history and the escape/tab key for command
> completion, but on my remote web host (webpipe.net) those keys don't work.
> What do I need to do to get these features working on my remote web host?
> I've seen reference to .psqlrc in the psql man file, but not much else (no
> syntax, etc).

*sigh* another candidate for the FAQ, I think.

The history keys rely on the GNU readline library.  If that library is not
available on your system, the history keys don't work.  If you compile
postgres from scratch, make sure you have also installed the
readline-devel rpm as well, so you get the header files, else the
configure phase of the compile will not properly detect and use the
library.

Brett W. McCoy
 http://www.chapelperilous.net/~bmccoy/
---
Criticism comes easier than craftsmanship.
-- Zeuxis




Re: [SQL] newbie: execute an sql script

2000-11-23 Thread Indraneel Majumdar

at the psql prompt do this:

\i 

On Sun, 19 Nov 2000 [EMAIL PROTECTED] wrote:

> hi everyone,
> just wanna ask how I could execute an sql script to feed into the
> database?
> 
> Jess Emerson Uy
> [EMAIL PROTECTED]
> 

/.
# Indraneel Majumdar  ¡  E-mail: [EMAIL PROTECTED]  #
# Bioinformatics Unit (EMBNET node),  ¡  URL: http://scorpius.iwarp.com  #
# Centre for DNA Fingerprinting and Diagnostics, #
# Hyderabad, India - 500076  #
`/




Re: [SQL] psql question(actually readline etc.)

2000-11-23 Thread Antti Linno

Good morning.

Since I asked this question before psql question, I would mention other
aspects as well. I had same problem, history not working etc. So I was
told to install readline. I checked, and readline rpm was installed. So
next thing, I was told, was to upgrade my postgres. I checked for update
rpm-s and installed them. Problem solved, case closed.
I didn't mention, that all that happened with Mdk 7.2 distribution. So it
isn't always readline or postgres. Maybe its readline, postgres 7.0.2 and
distribution, because postgres 7.0.3 works well now.

Ok, lets end this thread

Greetings,
Antti






[SQL] MySQL -> Postgres dump converter

2000-11-23 Thread Max Fonin

Hi.

MySQL->Postgres dump converter is now available at 
http://ziet.zhitomir.ua/~fonin/code/my2pg.pl.
Still beta and bugsome version but working, supports MySQL ENUMs, near the end are SET 
emulation.
Please help me to test.

Max Rudensky.