Delete w/ regexp

Started by Steve Wolfealmost 25 years ago8 messagesgeneral
Jump to latest
#1Steve Wolfe
steve@iboats.com

On one of our tables, this works fine:

select * from images where path ~* 'packages/site_system';

However, this:

delete from images where path ~* 'packages/site_system';

will make it work for a second or two, then give:

pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

This is with Postgres 7.0.2. Any ideas what's going on?

steve

#2Steve Wolfe
steve@iboats.com
In reply to: Steve Wolfe (#1)
Re: Delete w/ regexp

This gets even better:

delete from images where image_id=30031;

gives:

pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

I can vacuum the table just fine. I did a pg_dump on the entire database,
did destroydb and createdb, and piped in the output from pg_dump, all worked
without any complaint or error - but trying to delete from this table still
horks it up. Suggestions?

steve

#3Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Steve Wolfe (#1)
Re: Delete w/ regexp

Do you have any triggers or fk constraints that reference
the table?

On Thu, 19 Apr 2001, Steve Wolfe wrote:

Show quoted text

On one of our tables, this works fine:

select * from images where path ~* 'packages/site_system';

However, this:

delete from images where path ~* 'packages/site_system';

will make it work for a second or two, then give:

pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

This is with Postgres 7.0.2. Any ideas what's going on?

#4Steve Wolfe
steve@iboats.com
In reply to: Stephan Szabo (#3)
Re: Delete w/ regexp

Do you have any triggers or fk constraints that reference
the table?

No triggers or FK. The primary key has a 'default nextval('images_seq')',
but other than that, nothing.

steve

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Steve Wolfe (#2)
Re: Delete w/ regexp

"Steve Wolfe" <steve@iboats.com> writes:

Suggestions?

Show us a gdb backtrace from the backend core dump?

regards, tom lane

#6Steve Wolfe
steve@iboats.com
In reply to: Steve Wolfe (#1)
Re: Delete w/ regexp

Suggestions?

Show us a gdb backtrace from the backend core dump?

Sounds like a good suggestion to me. : )

Where would the core file be found? I could not find it in the working
directory, in the home directory, or under /usr/local/pgsql. I have a few
other ideas, I'll investigate and report if I find anything interesting.

steve

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Steve Wolfe (#6)
Re: Delete w/ regexp

"Steve Wolfe" <steve@iboats.com> writes:

Show us a gdb backtrace from the backend core dump?

Sounds like a good suggestion to me. : )

Where would the core file be found?

Should be in $PGDATA/base/YOURDB/core.

If it's not there, then either (a) the backend is not actually crashing,
but doing a semi-controlled exit --- check the postmaster log to find
out; or (b) no core dump is being made because you started the
postmaster with ulimit settings that forbid a core dump. (b) is pretty
likely on Linux machines because "ulimit -c 0" is the standard context
for system boot scripts. Try restarting the postmaster with "ulimit -c
unlimited" (I'd suggest putting this into the PG startup script).

regards, tom lane

#8Steve Wolfe
steve@iboats.com
In reply to: Steve Wolfe (#1)
Re: Delete w/ regexp

Show us a gdb backtrace from the backend core dump?

Sounds like a good suggestion to me. : )

Where would the core file be found?

Should be in $PGDATA/base/YOURDB/core.

Hmm... well, never mind. : )

Today, after the nightly vacuum, it works. I don't know why, it didn't
work after repeated vacuums, dumps, restores, and vacuums, but hey... I
won't complain.

steve