Query is too long

Started by Silvio Emanuel Barbosa de Macedoabout 27 years ago8 messagesgeneral
Jump to latest

Hi!
I was using psql to insert data into the database.
I have *.sql files with the necessary scripts, eg:

insert into descritor values (4992,'MARCHAS DE LISBOA','te','cl');

After many inserts... I've got this message:

query buffer max length of 20000 exceeded
query line ignored

and then, a few inserts later, because the scritp went on...

PQsendQuery() -- query is too long. Maximum length is 8191
query buffer max length of 20000 exceeded
query line ignored
Segmentation fault (core dumped)

Gdb on the core:
(gdb) bt
#0 0x401066f8 in ?? () from /lib/libc.so.6
#1 0x401066a1 in ?? () from /lib/libc.so.6
#2 0x804e85b in MainLoop ()
#3 0x804df44 in HandleSlashCmds ()
#4 0x804e7c0 in MainLoop ()
#5 0x804ef2d in main ()

What has happened ? How can I avoid it ? Maybe using psql -f instead using
\i inside psql ?

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C Tel:351 2 209 42 21
4000 PORTO PORTUGAL Fax:351 2 208 41 72

#2Clark Evans
clark.evans@manhattanproject.com
In reply to: Silvio Emanuel Barbosa de Macedo (#1)
OID

I'm designing a database schema and have questions about OID.

First, I assume that OID are system assigned? [yes]
Second, Can I use OID as a primary key? [no]
Third, Is the OID invariant under an import/export process? [no]
Fourth, Can I create table with an OID type for referencing another
table? [no]

I puy my assumed answers in brackets. Please let me know if I
am mistaken.

Thanks!

Clark

#3Evan Howarth
EHowarth@Intellicall.com
In reply to: Clark Evans (#2)
RE: [GENERAL] OID

I'm designing a database schema and have questions about OID.

First, I assume that OID are system assigned? [yes]

Second, Can I use OID as a primary key? [no]

Perhaps in ignorance, I have used the system assigned OID
as a non-topical primary key. Instead of using the
"PRIMARY KEY" key words, I explicitly created an index
on the OID column.

Third, Is the OID invariant under an import/export process? [no]

Fourth, Can I create table with an OID type for referencing
another table? [no]

You can create a row of type OID. I have used them
as foreign keys the times I used the OID field as the
primary key.

#4Jackson, DeJuan
djackson@cpsgroup.com
In reply to: Evan Howarth (#3)
RE: [GENERAL] OID

I'm designing a database schema and have questions about OID.

First, I assume that OID are system assigned? [yes]

yes - correct assumption

Second, Can I use OID as a primary key? [no]

yes(qualified) - incorrect assumption
Currently PostgreSQL doesn't really do anything special with primary key
columns, so you can achieve the same affect, by declaring a UNIQUE INDEX
on the same columns.

Third, Is the OID invariant under an import/export process? [no]

yes(qualified) - incorrect assumption
see: pg_dump --help (specifically the -o option).

Fourth, Can I create table with an OID type for referencing another
table? [no]

yes - incorrect assumption
This is part of the reason for the -o switch in pg_dump.

I puy my assumed answers in brackets. Please let me know if I
am mistaken.

Well, only 75%.

Thanks!

You're welcome.

Clark

-DEJ

#5Bob Dusek
bobd@palaver.net
In reply to: Silvio Emanuel Barbosa de Macedo (#1)
Re: [GENERAL] Query is too long

Hey there,

One way to execute .sql scripts in your database is this:

psql -e dbname < script.sql

That is how we recreate our databases from a dump file.

"psql -ef script.sql dbname" seems to have the same problem
you were having with the \i command:

query buffer max length of 20000 exceeded

good luck,

Bob

On Fri, 15 Jan 1999, Silvio Emanuel Barbosa de Macedo wrote:

Show quoted text

Hi!
I was using psql to insert data into the database.
I have *.sql files with the necessary scripts, eg:

insert into descritor values (4992,'MARCHAS DE LISBOA','te','cl');

After many inserts... I've got this message:

query buffer max length of 20000 exceeded
query line ignored

and then, a few inserts later, because the scritp went on...

PQsendQuery() -- query is too long. Maximum length is 8191
query buffer max length of 20000 exceeded
query line ignored
Segmentation fault (core dumped)

Gdb on the core:
(gdb) bt
#0 0x401066f8 in ?? () from /lib/libc.so.6
#1 0x401066a1 in ?? () from /lib/libc.so.6
#2 0x804e85b in MainLoop ()
#3 0x804df44 in HandleSlashCmds ()
#4 0x804e7c0 in MainLoop ()
#5 0x804ef2d in main ()

What has happened ? How can I avoid it ? Maybe using psql -f instead using
\i inside psql ?

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C Tel:351 2 209 42 21
4000 PORTO PORTUGAL Fax:351 2 208 41 72

#6Bob Dusek
bobd@palaver.net
In reply to: Bob Dusek (#5)
Re: [GENERAL] Query is too long

Sorry,

I should have been more clear:

One way to execute .sql scripts in your database is this:

psql -e dbname < script.sql

That should be done from the command line.

Show quoted text

That is how we recreate our databases from a dump file.

"psql -ef script.sql dbname" seems to have the same problem
you were having with the \i command:

query buffer max length of 20000 exceeded

good luck,

Bob

On Fri, 15 Jan 1999, Silvio Emanuel Barbosa de Macedo wrote:

Hi!
I was using psql to insert data into the database.
I have *.sql files with the necessary scripts, eg:

insert into descritor values (4992,'MARCHAS DE LISBOA','te','cl');

After many inserts... I've got this message:

query buffer max length of 20000 exceeded
query line ignored

and then, a few inserts later, because the scritp went on...

PQsendQuery() -- query is too long. Maximum length is 8191
query buffer max length of 20000 exceeded
query line ignored
Segmentation fault (core dumped)

Gdb on the core:
(gdb) bt
#0 0x401066f8 in ?? () from /lib/libc.so.6
#1 0x401066a1 in ?? () from /lib/libc.so.6
#2 0x804e85b in MainLoop ()
#3 0x804df44 in HandleSlashCmds ()
#4 0x804e7c0 in MainLoop ()
#5 0x804ef2d in main ()

What has happened ? How can I avoid it ? Maybe using psql -f instead using
\i inside psql ?

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C Tel:351 2 209 42 21
4000 PORTO PORTUGAL Fax:351 2 208 41 72

In reply to: Bob Dusek (#6)
Re: [GENERAL] Query is too long

On Fri, 15 Jan 1999, Bob Dusek wrote:

Sorry,
I should have been more clear:

One way to execute .sql scripts in your database is this:
psql -e dbname < script.sql

That should be done from the command line.

Yes... I imagined....

Anyway, Query Buffer being full I CAN understand..., but
core dump ?! hummm... I think there should be some little correction
there...
It appears to me that if a core dump (SIGNAL=11=SIGSEV) is generated,
something inside is not ok... and could show up in other more orthodox
situations...

PQsendQuery() -- query is too long. Maximum length is 8191
query buffer max length of 20000 exceeded
query line ignored
Segmentation fault (core dumped)

Gdb on the core:
(gdb) bt
#0 0x401066f8 in ?? () from /lib/libc.so.6
#1 0x401066a1 in ?? () from /lib/libc.so.6
#2 0x804e85b in MainLoop ()
#3 0x804df44 in HandleSlashCmds ()
#4 0x804e7c0 in MainLoop ()
#5 0x804ef2d in main ()

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C Tel:351 2 209 42 21
4000 PORTO PORTUGAL Fax:351 2 208 41 72

In reply to: Bob Dusek (#6)
Re: [GENERAL] Query is too long - thanks

On Fri, 15 Jan 1999, Bob Dusek wrote:

Sorry,

One way to execute .sql scripts in your database is this:
psql -e dbname < script.sql
good luck,
Bob

Ohh... sorry... I forgot to thank you! Thank you... :)

Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt