Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-02 Thread Gregory S. Williamson
Perhaps it is clogged with dead tuples -- has it been vacuumed recently with enough FSM space ? It seems unlikely but maybe try an explict cast for the thing_id call, e.g. explain update xx_thing_event set thing_color='foo' where thing_event_id=1::bigint; It may also be that 5842 rows is eno

[SQL] Sequential scan where Index scan expected (update)

2006-03-02 Thread Bryce Nesbitt
I'm getting sequential scans (and poor performance), on scans using my primary keys. This is an older postgres. Can anyone help figure out why? demo=# \d xx_thing Table "public.xx_thing" Column |Type | Modifiers -

[SQL] Sequential scan where Index scan expected.

2006-03-02 Thread Bryce Nesbitt
I'm getting sequential scans (and poor performance), on scans using my primary keys. Can anyone help figure out why? demo=# \d xx_thing Table "public.xx_thing" Column |Type | Modifiers -+

Re: [SQL] How to check date-interval constraints

2006-03-02 Thread Michael Glaesemann
On Mar 3, 2006, at 14:13 , Michael Fuhr wrote: On Fri, Mar 03, 2006 at 04:28:01AM +0100, Andreas wrote: How can I have a constraint, that prohibits nesting or overlapping intervals? 172006-1-1 2006-1-31 292006-2-1 2006-2-28 OK 352006-1-10 2006-1

Re: [SQL] How to check date-interval constraints

2006-03-02 Thread Michael Fuhr
On Fri, Mar 03, 2006 at 04:28:01AM +0100, Andreas wrote: > How can I have a constraint, that prohibits nesting or overlapping > intervals? > > 172006-1-1 2006-1-31 > 292006-2-1 2006-2-28 OK > 352006-1-10 2006-1-20 BAD lies within line

[SQL] How to check date-interval constraints

2006-03-02 Thread Andreas
Hi, I'd like to have a table that looks like this: my_option ( id serial primary key, myvalue double, valid_start timestamp, valid_stop timestamp ); I want to store values that are only valid in a given start-stop-interval so I could find a date-specific value for

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-02 Thread Simon Kinsella
Hi Andrew, I think I may have cracked this problem by combining a RULE ON DELETE which calls a function instead of the standard DELETE op. No triggers. It was a real nightmare as it was my first attempt at a rule and it kept ending up in circular self-references. In the end though it boiled down

Re: [SQL] Why can't I use daylight savings time aware time zones with the AT TIME ZONE clause?

2006-03-02 Thread Michael Fuhr
On Thu, Mar 02, 2006 at 02:33:08PM -0800, Davidson, Robert wrote: > I would like to use daylight savings time aware time zones to > display dates, but can't seem to get them to work no matter what > alias I use: > > select '2005-02-25 00:00:00 -800' AT TIME ZONE 'CST6CDT' as interval > ... > ERROR

[SQL] Why can't I use daylight savings time aware time zones with the AT TIME ZONE clause?

2006-03-02 Thread Davidson, Robert
Title: Why can't I use daylight savings time aware time zones with the AT TIME ZONE clause? I would like to use daylight savings time aware time zones to display dates, but can't seem to get them to work no matter what alias I use: select '2005-02-25 00:00:00 -800' AT TIME ZONE 'CST6CDT' as

Re: [SQL] Question about Sql SELECT and optimizer

2006-03-02 Thread Michael Fuhr
On Thu, Mar 02, 2006 at 11:19:32AM -0500, Chaz. wrote: > I am trying to understand something I have seen happen. I had a select > that looked like: > > select f(A) from A, B, C where g(A) > > Where f(A) is the select that only depends on table A; > g(A) is the where part that only depends on tabl

Re: [SQL] dump with lo

2006-03-02 Thread Maciej Piekielniak
Hello Tom, Thursday, March 2, 2006, 4:21:22 PM, you wrote: TL> Maciej Piekielniak <[EMAIL PROTECTED]> writes: >>I try copy my old database with large objects from postgresql7.4 to >>postgresql-8.1. >>How can I dump database with lo? pg_dumpall don't save lo. TL> Use 8.1's pg_dump and

[SQL] Question about Sql SELECT and optimizer

2006-03-02 Thread Chaz.
I am trying to understand something I have seen happen. I had a select that looked like: select f(A) from A, B, C where g(A) Where f(A) is the select that only depends on table A; g(A) is the where part that only depends on table A. What I saw happen was the optimizer will waste a lot of time (s

Re: [SQL] Without OIDs

2006-03-02 Thread Michael Fuhr
On Thu, Mar 02, 2006 at 05:14:54AM -0800, Emil Rachovsky wrote: > I'm creating a temporary table in a function and using > Alter Table ... Without OIDs, but when the function is Why alter the table? Why not specify WITHOUT OIDS when you create the table? > called for the second time I get an err

Re: [SQL] Change date format through an environmental variable?

2006-03-02 Thread george young
Try the PGDATESTYLE environment variable. Works in 7.4 and 8.1, though it is claimed to be deprecated. -- George Young On Wed, 01 Mar 2006 12:32:26 -0500 Mark Fenbers <[EMAIL PROTECTED]> threw this fish to the penguins: > I want to get Pg (v7.4.7) to output a date field in a different format >

Re: [SQL] dump with lo

2006-03-02 Thread Tom Lane
Maciej Piekielniak <[EMAIL PROTECTED]> writes: >I try copy my old database with large objects from postgresql7.4 to >postgresql-8.1. >How can I dump database with lo? pg_dumpall don't save lo. Use 8.1's pg_dump and pg_dumpall to dump from the old server. We fixed that problem finally.

[SQL] FW: sql copy does not work

2006-03-02 Thread Aniko.Badzong
Title: FW: sql copy does not work Hi I have a problem with the copy command. I need to write a Perl script where I copy the log files into the database. If I use the copy following syntax in shell script it works, but I need to use it in Perl. In shell script look like this and it work

[SQL] Without OIDs

2006-03-02 Thread Emil Rachovsky
Hello, I'm creating a temporary table in a function and using Alter Table ... Without OIDs, but when the function is called for the second time I get an error "relation with OIDs ... doesn't exist" on an insert statement to the table. I'm using Postgre 8.0 which says that supports without OIDs. An

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-02 Thread Andrew Sullivan
On Wed, Mar 01, 2006 at 08:41:20PM -, Simon Kinsella wrote: > Ok thanks, will check this out. Is that the same as savepoints, or something > different? (am using 8.1.2) Yes, same thing. > At the moment I'm investigating using a rule (rewrite the DELETE as an > UPDATE to set the flag, then use

[SQL] dump with lo

2006-03-02 Thread Maciej Piekielniak
Hello pgsql-sql, I try copy my old database with large objects from postgresql7.4 to postgresql-8.1. How can I dump database with lo? pg_dumpall don't save lo. -- Best regards, Maciej mailto:[EMAIL PROTECTED] ---(end of broadcast)-

Re: [SQL] Change date format through an environmental variable?

2006-03-02 Thread Peter Eisentraut
Am Donnerstag, 2. März 2006 08:33 schrieb Michael Fuhr: > I see LC_COLLATE and LC_CTYPE in a few places but not in the > documentation for postgres/postmaster, which is where they appear > to be used (backend/main/main.c). Should those pages mention them? No, these variables are not used there, o