e plenty of such gaps in our operator set...
> Shouldn't
> INTERVAL / INTERVAL = INTEGER?
I'd think the output should be FLOAT8, myself, since the result
could be fractional.
Anyway, the generic response to such questions is "feel free to
code it up and submit a p
lus 4.5 days,
and then we translate the .5 months into 15 days.
This is pretty grotty, and AFAIK not documented anywhere --- I found it
out by looking at the C code for these operators. But I'm not sure
how to do better.
regards, tom lane
n tests, "1 day" and "24 hours"
are not the same thing.
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
95 measured with respect to the length
of February, or of March? Does it matter that 2000 is a leap year?
There may be some other operations that have sensible interpretations
for such a datatype, however.
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
users just want to do simple
> things. Like we want to know how many weeks an employee has been with
> us for: '2 years 3 months'::INTERVAL / '1 week'::INTERVAL (and we
> don't care about the fractional week left over).
Good point. Ugly as the "30 day&
ation recommend
$conn = Pg::connectdb(whatever);
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
Try that, and if you're still in the dark, let us see the error
message...
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
ally comparable only with other day-
time intervals. [...]
Operations involving items of type datetime require that the date-
time items be mutually comparable. Operations involving items of
type interval require that the interval items be mutually compara-
ble.
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> Hmmm ... does this mean that I couldn't divide '1 year' by '1 week'?
That's exactly what it says.
regards, tom lane
---(end of broadcast)
mp dump them correctly?
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
optional. However, Postgres contains a
lot of extensions to SQL92, and some of them produce parse ambiguities
if AS is optional. So we require it. This isn't going to change, as
it would require ripping out a lot of useful stuff.
regards, tom lane
--
era (accion,tabla) VALUES ('D','carrera');
> );
I think you need the patch for multi-action rules --- see
http://www.ca.postgresql.org/cgi/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteHandler.c
You need version 1.93.2.1, assuming that you're on PG 7.1.2.
ple in the SELECT
reference page.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get
Carolyn Lu Wong <[EMAIL PROTECTED]> writes:
> When trying to delete data from a table, get the following error:
> ExecutePlan: (junk) `ctid' is NULL!=ODBC.QueryDef
May we see the query and table schema?
regards, tom lane
---
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> SHould I be concerned about this?
> DEBUG: geqo_main: using edge recombination crossover [ERX]
Nope. See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/geqo.html
Gary Stainburn <[EMAIL PROTECTED]> writes:
> ... However, I cannot find the
> syntax to create a function in SQL. Specifically, how you return the result.
See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xfunc.html#XFUNC-SQL
regar
ator + (procedure = textcat,
regression(# leftarg = text, rightarg = text);
CREATE
regression=# select 'aa'::text + 'bb'::text;
?column?
--
aabb
(1 row)
Whether this is a good idea is another question --- but if Bill's
intent on not using the SQL-standard text co
be formed on the basis of the actual query; there's
no way to pull out the part for a view.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
MVCC does not mean "no locks" ... particularly not when UPDATEs are
involved. You'll need to be more specific about what your function is
doing, but my first thought would be to look for the possibility of
conflicting updates of the same row.
re
oss rows.
This will probably be much faster than your other approach anyway, since
it doesn't require re-finding each row with a fresh UPDATE. A function
call is a whole lot cheaper than parsing, planning, and executing a new
query.
regards, tom lane
---
Oleg Lebedev <[EMAIL PROTECTED]> writes:
> What am I doing wrong?
Using 7.0, perhaps? The query parses fine for me in 7.1.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archiv
imply that a correlation name would NOT be accepted.
It took a fair amount of work to derive a grammar that was unambiguous
and still accepted everything...
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
table, as opposed to writing a
sub-SELECT-in-the-FROM-clause? ISTM that that feature takes care
of most of the simple notational reasons for wanting a temp table.
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and un
x27;cp -p -r' or 'tar' or some such), put a symlink to the new place
at /var/lib/pgsql/data, and away you go. Or forget the symlink and
instead tell the postmaster where the data tree is with a -D switch.
regards, tom lane
---(end of bro
simplify your life by reversing
the ordering and choosing the second row (OFFSET 1 LIMIT 1).
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
bright enough to choose fast-startup plans
over least-total-cost plans in cases where fast-startup is what you want.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.pos
se that stuff works fine AFAIK.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
g, but a
deliberate simplification to save planning time. The planner cannot
alter the number of times the SELECT output expressions are evaluated
(at least not if it's delivering the right answer) so there's no point
in worrying whether they are expensive or cheap. But it would include
-> Seq Scan on tenk1 (cost=0.00..333.00 rows=1 width=148)
EXPLAIN
which seems at least moderately self-explanatory.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.po
ay value in SQL or plpgsql languages.
I know that you can do it in pltcl (there are examples in the pltcl
self-test), and of course you can do it in C. A brute-force solution
is to make a support function in one of those languages that takes two
varchars and returns an array of varcha
ge section, but a section nonetheless. Any
volunteers to write it?
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
n choices. See ALTER TABLE SET
STATISTICS. I'd be interested to hear about it if so --- the current
default target of 10 was picked "out of the air" and might well be
off-base.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
is the right thing.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
thus, you can't have references to tables that aren't part of that
sub-SELECT. This is a lot different from subselects in WHERE, the
select target list, etc, since they can depend on their context.
If you can think of a clearer way of phrasing the docs, let's have
he weather-report example
on the SELECT reference page for inspiration). But I'm still pretty
fuzzy on what the table layout is and why this computation makes any
sense. Maybe the real answer is to back up a few steps and reconsider
your table design.
he optimizer
picking bad plans because it can't see the exact values being used in
queries. Can you show us the details of the function?
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
umber of
updates that you do? Twelve passes of updates seems like a lot. Maybe
you could restructure things to allow the data to be assembled in fewer
steps.
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off a
ost=109.96..109.96 rows=25 width=20)
-> Merge Join (cost=0.00..109.38 rows=25 width=20)
-> Index Scan using ut_pkey on ut (cost=0.00..52.00 rows=1000 width=8)
-> Index Scan using ml_f1f2 on ml (cost=0.00..52.00 rows=1000 width=12)
which doesn't look to
ne ml value at all?
The DISTINCT ensures you get only one row per f1/f2 combination, and
the use of ORDER BY together with DISTINCT ON forces it to be the row
with the maximal ml value. See the SELECT reference page.
regards, tom lane
---
idea. It would slow down all queries (probably by quite a bit)
for a benefit that I suspect arises relatively seldom. Might be worth
looking at this sometime in the future, but...
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
27;F' OR p.profiles_orientation[1]='M');
I suspect the main problem may be lack of stats about the array element
distributions. Does profiles_orientation really need to be an array,
or could you break it out into separate fields?
n't
> know which ID to use? any suggestions?
Use ctid to distinguish the rows. Note ctid will change if you update
a row, so it's not a permanent identifier either, but it will serve for
deleting a row.
regards, tom lane
---(end of broadc
Indeed.
> Is this fixed in the upgrade versions?
Yes.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
stgres absolutely does not care: the optimizer will always consider
both A-join-B and B-join-A orders for every join it has to do. As
Stephan and Josh noted, you can constrain the join pairs the optimizer
will consider if you use explicit-JOIN syntax --- but each pair will be
considered in both dir
rd
output columns of the UNION.
Pre-7.1 got this wrong (and would sometimes produce wrong output
ordering or even a backend crash, if the arms of the UNION didn't
all yield the same datatype).
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
. See the
list archives for more detail than you really wanted.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly
strongly...
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
the postmaster
with? Try setting it to 1500 or more, if it's not already.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
d.
Jeffrey must be running into some kind of buffer-leak bug ... but it's
hard to think what, unless he's running an extremely old PG version.
We haven't seen reports of buffer leaks in a long time. So I'd like
to run that down, quite independently of whether he sh
t
(1 row)
regression=# select ':' ~ '[A-Za-z0-9_]';
?column?
--
f
(1 row)
How old is your Postgres? (I can tell by the spelling of the error
message that it's not current.)
regards, tom lane
---(end of br
's not hard:
SELECT DISTINCT ON (userid) userid, val, ts FROM table
ORDER BY userid, ts DESC;
See the DISTINCT ON example in the SELECT reference page for more info:
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/sql-select.html
regards, tom lane
this statement is wrong, and that we do follow the spec.
There have been a number of arguments about this in the past though...
evidently whoever touched this doc page last had the opposite opinion.
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
count(distinct ...) isn't bright enough to make use of indexes.
Now an index on (a,b) can substitute for an index on a, so if you
have other queries that could use both columns of the (a,b) index
then it might be worth making that instead of an index on a.
s question several times
before, with no permanent resolution --- the plain fact is that the
spec isn't very clearly written. Useful data would be tests
demonstrating how other systems (Oracle, DB2, etc) interpret the issue.
regards, tom lane
---(e
that will be faster than an indexscan. It's not necessarily
wrong. Have you compared the explain output and actual timings both
ways? (Use "set enable_seqscan to off" to force it to pick an indexscan
for testing purposes.)
regards, tom lane
-
AS ON UPDATE TO dbl DO INSTEAD UPDATE raw SET
id = NEW.id / 2, name = NEW.name WHERE OLD.id = id * 2;
(untested...)
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
u get only one copy of cross-posted messages. It's a real
godsend IMHO. Set your subscription class to "unique" rather than
"each" for all lists you are on, and presto.
regards, tom lane
---(end of broadcast)
uitable.
Write a function in pltcl or plperl, either of which can mash text
strings with ease and abandon ...
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
o produce a 7.2 beta :-(. Producing another 7.1 patch release
isn't in the cards.
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
ery using an explicit cast
Got any triggers, rules, or foreign keys for this table? The error is
not necessarily in the command you typed, it could be in subsidiary
processing.
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
m
of AND (the keyword-AND operator isn't a function). I'll leave that
part as an exercise for the student ...
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
I think you need "return old", not "return new", in the body of the
trigger if you want the delete to take place. new would be NULL in
a delete situation ...
regards, tom lane
---(end of broadcast)---
Why are you using PG 7.0.2? 7.1.3 is the current release.
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Alex Pilosov <[EMAIL PROTECTED]> writes:
> I'm going to CC this to -hackers, maybe someone will shed a light on the
> internals of this.
It's not unintentional. See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/explicit-joins.html
the schema you are actually
working with --- how many tables are implied by "brick*", for example?
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
could measure the difference --- what results are you getting?
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
=?iso-8859-1?Q?Miguel_Gonz=E1lez?= <[EMAIL PROTECTED]> writes:
> But I got that the parser cannot identify the =$ operator
You need a space between = and $.
regards, tom lane
---(end of broadcast)---
TIP 2: you ca
ld be using INSERT not COPY.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
or
pgsql-novice is pretty tiny. I see 12 postings so far this month.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
rows=10 width=12)
EXPLAIN
The difference is probably a locale problem: if you aren't in C locale
then the index LIKE optimization is disabled because it doesn't work
reliably. See the list archives for more info.
regards, tom lane
---
h caturljoin
row? How many urllist rows ditto?
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
lower() to be applied to an int2 field. If your app expects to be able
to apply lower() to any datatype at all, I'd say your app is broken.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Us
behavior be? Can a long-lived function validly refer to
short-lived tables? If so, what should the semantics be, exactly?
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregiste
ere not up to date --- if
the doc/TODO file doesn't contain a date in October, it's stale).
I think the only thing we're still waiting on is some datetime fixes
from Tom Lockhart...
regards, tom lane
---(end of broadcast)---
older (try "select version()" to prove it).
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
"Robin's PG-SQL List" <[EMAIL PROTECTED]> writes:
> I have a query using the SUM() function that is not returning the
> appropriate results.
I'm guessing that you have two rows in bolcustomer matching
bol_number = 88738, so that the 14 gets added in twice.
also affect updates of
child tables, but tracing through your example with 7.1 shows clearly
that the CHECK is being applied to a slot that contains a four-column
tuple and only a three-column descriptor. Ooops.
regards, tom lane
to_timestamp
+
March 11, 1997 | 1997-03-11 00:00:00-05
(1 row)
However, I'd agree that this shows a lack of robustness in to_timestamp;
it's not objecting to data that doesn't match the format.
regards, tom lane
---
gSQL,
> but not in Postgres SQL.
It does work in 7.2devel, however ...
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
??
Because the IEEE float math standard says so. Round-to-nearest-even
is considered good practice.
> How do I get to approximate any number x.5 as x+1 ??
Try FLOOR(x + 0.5) if you really want the other behavior.
regards, tom lane
---(end of
the planner
assumes that automatically.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly
any rows.
FWIW, 7.2 has better statistics and should be better able to pick the
right plan in this context ...
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send &
returned zero. I just
double checked, and I get a NULL there too. If we ever returned zero,
it was a long time ago.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropr
hable" and "not cachable",
along the lines of "result is constant within a query", so that the
behavior of now() can be described more accurately.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
clause with the available indexes, and then sees
whether the clauses they are mentioned in are comparisons that the index
can help with. In this case the "thing" mentioned is "function(column)"
rather than just "column", but otherwise it's just lik
like, constants or $n parameters
only.
I do not know of any median-finding algorithm that doesn't require a
depressingly large amount of storage...
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading thro
leo <[EMAIL PROTECTED]> writes:
> CREATE FUNCTION editEmail(integer, smallint, varchar, varchar) RETURNS
> integer AS '
> ...
> -- if it wasn't, then insert the new record.
An undoubled quote mark in a function body is bad news...
"Aasmund Midttun Godal" <[EMAIL PROTECTED]> writes:
> How can I restrict access to large objects.
You can't. This is one of the many deficiencies of large objects.
regards, tom lane
---(end of broadcast)-
zero rows were updated, so of course there was nothing to fire
the trigger on.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Christopher Sawtell <[EMAIL PROTECTED]> writes:
> On Tue, 16 Oct 2001 03:46, Tom Lane wrote:
>> You can't. This is one of the many deficiencies of large objects.
> But now that the limit on row length / size has gone away, and that the new
> BYTEA type has appeared, i
a VACUUM, the query bogs down.
What has been changing in the meantime?
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
omplicated for
yourself. One big table with a suitable index ought to work fine.
regards, tom lane
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
emselves
only as database errors. Evidently Postgres was pushing the disk harder
than anything else on the system, so it was more likely to get bit by
a sporadic hardware booboo.
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
useless table reference. But you can take comfort in the fact that
there's a simple workaround if you're ever forced to use a DBMS that
won't accept this syntax.
regards, tom lane
---(end of broadcast)--
rs will probably work better than rules.
regards, tom lane
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
recall
many (if any) prior reports of such failures, so I'm leaning towards a
hardware glitch having caused it. I'd recommend running some memory and
disk diagnostics ...
regards, tom lane
---(end of broadcast)---
T
es ($masterid, ...);
insert into detail ... $masterid ...;
rather than letting the default expression do it for you.
regards, tom lane
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
g a clean distinction
between plan tree and execution state.
regards, tom lane
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
o a
> builtin C function.
What does this do that isn't already done by quote_literal?
regards, tom lane
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Dirk Lutzebaeck <[EMAIL PROTECTED]> writes:
> say I have a join which says
> t.a = t.b and t.b = t.c
> do I need to give the optimizer a hint by saying it more redundantly
> t.a = t.b and t.b = t.c and t.c = t.a
Not since about 7.0.3 ...
501 - 600 of 2610 matches
Mail list logo