Re: [SQL] trigger/for key help

2004-04-13 Thread Tom Lane
tial for conflict. I suppose we could use long randomly-generated names like ewjncm343cnlen, but are those really easier to work with? I think a more useful approach is to treat it as a documentation problem. Perhaps an example in the ALTER TABLE man page would help.

Re: [SQL] Formatting Functions and Group By

2004-04-13 Thread Tom Lane
x27;t give --- you've got month sorting to the left of year, is that really what you want? If it is then you'd need to go group by date_trunc('month', myCol) order by to_char(date_trunc('month', myCol), 'MM ') regards, to

Re: [SQL] trigger/for key help

2004-04-13 Thread Tom Lane
ther second character, and both of these are significantly more useful than the ability to have unquoted IDs starting with $ would be. So that's a dead end. I think if we wanted to change the default assignment of constraint names we'd just go with ordinary identifiers that we

Re: [SQL] function returning array

2004-04-13 Thread Tom Lane
[]; regression'# tmpv varchar; regression'# begin regression'# results := parseString(); regression'# tmpv := results[1]; regression'# RAISE NOTICE '' tmpv = % '',tmpv; regression'# return tmpv; regression'# end' language plpgsql; CREAT

Re: [SQL] Update is very slow on a bigger table

2004-04-15 Thread Tom Lane
backend to release an exclusive lock on the table, or an update lock on one of the rows to be updated. The pg_locks view might help you determine who's the culprit. regards, tom lane ---(end of broadcast)--- TIP 7: don

Re: [SQL] Prepared Statements and large where-id-in constant blocks?

2004-04-19 Thread Tom Lane
ibly this is something to improve someday, but there's surely no percentage in doing lots of work in the JDBC driver to prefer the IN form at the moment. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked o

Re: [SQL] relation X does not exist

2004-04-19 Thread Tom Lane
a different userid that has a different search path? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Server Side C programming Environment Set up

2004-04-21 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Join issue on a maximum value

2004-04-22 Thread Tom Lane
e why this works? The ORDER BY DESC is what forces the max image_id to be selected. Read the discussion of SELECT DISTINCT ON in the SELECT reference page; the "weather report" example may be illuminating. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Order by YYYY MM DD in reverse chrono order trouble

2004-04-22 Thread Tom Lane
LECT list as well, but no modern database has such a restriction anymore ... regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Server Side C programming Environment Set up

2004-04-22 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Am Donnerstag, 22. April 2004 07:59 schrieb Tom Lane: >> For instance I've been meaning to ask what to do about this open >> bug report: >> >> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=112244 &

Re: [SQL] Server Side C programming Environment Set up

2004-04-22 Thread Tom Lane
I don't think we are real close yet, though maybe Peter would have an idea what would be needed. (Note this would also provide a usable solution to the build-the-tutorial problem I mentioned.) regards, tom lane ---(end of broadcast)---

Re: [SQL] lifetime of temp schema versus compiled image of plpgsql proc

2004-04-22 Thread Tom Lane
27;s a bit hard to believe. Could we see a complete test case? regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] lifetime of temp schema versus compiled image of plpgsql proc

2004-04-22 Thread Tom Lane
y the error message complains about the temp *schema* and not a temp table. There's something very strange here, because the temp schema name for a given session is definitely fixed for the life of the session. regards, tom lane ---(end of broad

Re: [SQL] Is there an easy way to normalize-space with given string functions

2004-04-22 Thread Tom Lane
n in plperl or pltcl. (Mind you, I don't know why we don't offer a built-in one --- the needed regex engine is in there anyway. I guess no one has gotten around to getting agreement on a syntax.) regards, tom lane ---(end of broadcast)--

Re: [SQL] Server Side C programming Environment Set up

2004-04-23 Thread Tom Lane
t it so it still works for them after they're spun off. It seems silly to abandon the not-trivial work you and other people have already put into the contrib build system; and also silly to expect gborg projects to individually adapt it to their needs. regards, tom

Re: [SQL] CONTEXT on PL/pgSQL

2004-04-23 Thread Tom Lane
tures, it's likely that nothing will be done about it. Right now this is almost the only technique available for seeing what's going on inside a plpgsql function, and crummy as it is, it's better than nothing... regards, tom lane

Re: [SQL] How do i extract a certain bit from a bigint column

2004-05-12 Thread Tom Lane
t sure when the bigint >> and & operators got added, but \do would tell you quickly enough if they're in your version. Mind you that this is not going to be an especially fast solution, since these are not indexable operators. You might be better advised to rethink your data representation

Re: [SQL] new and old as parameter in a function

2004-05-06 Thread Tom Lane
able fooey(f1 int, f2 text); CREATE TABLE regression=# create function foo(fooey) returns int as ' regression'# begin regression'# return $1.f1; regression'# end' language plpgsql; CREATE FUNCTION regards, tom lane ---(end of b

Re: [SQL] Subselect returning 2 columns

2004-05-06 Thread Tom Lane
see documentation about subselects returning more than > one column, but it seems to work... http://www.postgresql.org/docs/7.4/static/functions-subquery.html#AEN12497 regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Permissions not working

2004-04-30 Thread Tom Lane
xact sequence of GRANT and REVOKE operations that were performed on this table? What PG version is this, exactly? regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] Performance issue

2004-04-30 Thread Tom Lane
deletion with TRUNCATE. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SPAM] Re: [SQL] Permissions not working

2004-05-03 Thread Tom Lane
't. It only revokes privileges directly associated with the database object, which are the rights to create new schemas and temp tables within the database. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/readi

Re: [SQL] Which SQL command creates ExclusiveLock?

2004-04-27 Thread Tom Lane
k? It says that no SQL command acquires ExclusiveLock *on a table*. The pg_locks row you show represents ExclusiveLock on a transaction number. Every transaction gets ExclusiveLock on its transaction number for the duration of its existence. regards, tom lane -

Re: [SQL] Multi ordered select and indexing

2004-04-29 Thread Tom Lane
OPERATOR4 <= , OPERATOR5 < , FUNCTION1 int4_reverse_order_cmp(int4, int4); Now you can just use ASC/DESC in your ORDER BY ... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Permissions not working

2004-04-29 Thread Tom Lane
isn't a supported operation. How did you do it exactly? I suspect that you got it wrong somehow ... > I dont want user 'test' to access any tables from the 'ups' > database, i tried revoking permissions it still doesnt work. What did you revoke? What does psql&

Re: [SQL] Procedure failing after upgrade

2004-05-05 Thread Tom Lane
at the resulting Datum should be interpreted as a bool. 7.4 will coerce to bool or throw an error if it can't. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [ADMIN] [SQL] \set

2004-05-12 Thread Tom Lane
er" does not exist regression=# \set AAA '\'whatever\'' regression=# select :AAA; ?column? -- whatever (1 row) regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] SCHEMA's the easy way?

2004-05-19 Thread Tom Lane
edit the "set search_path" commands in the dump script, reload. 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])

Re: [SQL] Function valid only for one table

2004-05-19 Thread Tom Lane
ks memory intraquery. That is fixed for 7.5 though. 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])

Re: [SQL] Simple view confuses PostgreSQL query planning

2004-05-20 Thread Tom Lane
le --- the first arm of each CASE will yield a non-null result for null input. Get rid of the CASEs (perhaps you could wrap them into functions declared STRICT) and the view would be flattenable. The reason we need this is shown in this old bug report: http://archives.postgresql.org/pgsql-bugs/2001-0

Re: [SQL] OR clause causing strange index performance

2004-05-20 Thread Tom Lane
lf-contained test case. 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])

Re: [SQL] Problem with JOINS

2004-05-21 Thread Tom Lane
gt; users.roles like '%Premium' AND binds more tightly than OR --- I suspect you wanted some parentheses. AND (bs.value = 'bezahlt' OR bs.value = 'erlassen') AND Or you could express the same thing using IN: AND bs.value IN ('bezahlt&#x

Re: [SQL] Preventing Deletions with triggers

2004-05-21 Thread Tom Lane
ks for me, in the sense that returning NULL prevents the deletion. However that assignment to OLD is a no-op: you can't change the tuple that way. You'd have to do something like UPDATE person SET status = 1 WHERE key = OLD.key; ("key" being w

Re: [SQL] Memory usage on subselect

2004-05-23 Thread Tom Lane
e on 7.4? Or see if you can rewrite the sreq function in plpgsql. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Memory usage on subselect

2004-05-24 Thread Tom Lane
or any of these tables. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] passing new/old record in pl/pgsql trigger functions to other functions

2004-05-30 Thread Tom Lane
7.5, but hopefully by the release after that it will. 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])

Re: [SQL] Index question

2004-05-31 Thread Tom Lane
es, the planner's choices are not surprising. You have not given us any information on whether those estimates are accurate. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

Re: [SQL] insert or update violates foreign key constraint.why?

2004-05-31 Thread Tom Lane
;s been some debate about whether this is really the most desirable behavior, but that's how it is at the moment. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http:/

Re: [SQL] Schemata & User-Defined-Type casting issues

2004-06-01 Thread Tom Lane
head and define an assignment cast WITHOUT FUNCTION to let you do the conversion. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] Query becoming slower on adding a primary key

2004-06-01 Thread Tom Lane
say about it? regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] function with a composite type calling another function - Mission Impossible?

2004-06-02 Thread Tom Lane
whole-row variables into SQL expressions, which is essentially what you've got here. There's some chance it will work in time for 7.5. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Selecting "sample" data from large tables.

2004-06-03 Thread Tom Lane
t (as reading a billion rows would take a while). Can > anyone thing of a way to do this is postgresql? There is a fairly decent random-sampling engine inside ANALYZE, but no way for the user to get at it :-(. Can you make any use of ANALYZE's results, viz the pg_stats view?

Re: [SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Tom Lane
"Stijn Vanroye" <[EMAIL PROTECTED]> writes: > I can't seem to find a way to substract two time values (or > timestamp values) and get a numeric/float value. I always get the > INTERVAL datatype. extract(epoch from interval) may help.

Re: [SQL] ANSI SQL-99 SYNTAX and "WITH"

2004-06-04 Thread Tom Lane
do with it, but at this point it's a pretty safe bet that it won't make 7.5. Maybe next time. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] date format in 7.4

2004-06-05 Thread Tom Lane
tyle says it is. See the very voluminous flamewar about ambiguous date input handling in the pgsql-hackers archives from last summer. > although the documentation still states the following AFAICS the documentation says so too... regards, tom lane

Re: [SQL] SQL DDL: FOREIGN KEY construct and field mapping: unexpected behavior

2004-06-06 Thread Tom Lane
the . The data type of each referencing column shall be the same as the data type of the corresponding referenced column. Nothing there about "try to match by name". regards, tom lane ---(end of broadcast)--

Re: [SQL] Formatting problems with negative intervals, TO_CHAR

2004-06-06 Thread Tom Lane
4 minutes'::interval - > '4 minutes 30 seconds'::interval, 'mi:ss'); > to_char > - > 00:-3 > (1 row) regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Scalar in a range (but textual not numeric)

2004-06-07 Thread Tom Lane
ngy and use the GiST indexing support on that. You'd have a query like WHERE min_max_object overlaps-operator 'ABCDE' and the overlaps operator would be a GiST-indexable one. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Getting FK relationships from information_schema

2004-06-07 Thread Tom Lane
re what it ought to look like. Can we get away with adding implementation-specific columns to information_schema tables? If not, what other alternatives are there? regards, tom lane ---(end of broadcast)--- TIP 2:

Re: [SQL] Scalar in a range (but textual not numeric)

2004-06-07 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > On Wednesday 25 February 2004 21:32, Tom Lane wrote: >>> SELECT * FROM blocks WHERE 'ABCDE' BETWEEN min AND max; >> >> Even if it did realize that, it couldn't do much, because this query >> isn't

Re: [SQL] Getting FK relationships from information_schema

2004-06-08 Thread Tom Lane
y such naming change to propagate to Joe's-Corner-Bar's database.) regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Schema + User-Defined Data Type Indexing problems...

2004-06-09 Thread Tom Lane
a.my_table USING btree (my_uuid USING my_schema.uuidopclass); It's possible that we could think of a more convenient behavior for default opclasses, but I don't want to do something that would foreclose having similarly-named datatypes in different schemas. You have any suggestions?

Re: [SQL] What's wrong with my date/interval arithmetic?

2004-06-09 Thread Tom Lane
2003-10-17 23:07:00-04 (1 row) Note the October date is taken as GMT-4, the December GMT-5. The hour gained in the fall DST transition is accounted for when doing timezone-aware arithmetic, but not when doing timezone-free arithmetic. I still think

Re: [SQL] Getting FK relationships from information_schema

2004-06-09 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> We have discussed changing the default names of FK constraints >> before. I have no problem with doing something like the above --- any >> objection out there? > I think it's a good idea. It w

Re: [SQL] Schema + User-Defined Data Type Indexing problems...

2004-06-10 Thread Tom Lane
quite unpleasant for operators :-( You can't write select * from foo where my_uuid = 'xxx'; instead select * from foo where my_uuid operator(my_schema.=) 'xxx'; Yech. I think you'll end up putting uuid's schema in your search path before long anyway.

Re: [SQL] Schema + User-Defined Data Type Indexing problems...

2004-06-10 Thread Tom Lane
ch path (probably via ALTER DATABASE). regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Datetime problem

2004-06-14 Thread Tom Lane
"Eric Lemes" <[EMAIL PROTECTED]> writes: > - select to_timestamp('2004 10 10 00 00 00', ' MM DD HH MI SS') > the output is: > - 2004-10-09 23:00:00-03 What PG version is this, on what platform, and what's your current timezone s

Re: [SQL] a query with = ALL

2004-06-14 Thread Tom Lane
mn is char(n) and the other is text or varchar(n) then you may get results you didn't expect. These types have different ideas about whether trailing blanks are significant or not. regards, tom lane ---(end of broadcast)---

Re: RES: [SQL] Datetime problem

2004-06-14 Thread Tom Lane
h would reverse-convert as 11:00 PM standard time... 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 yo

Re: RES: [SQL] Datetime problem

2004-06-14 Thread Tom Lane
it is. Fixed in CVS tip --- thanks for pointing it out. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] query with =ALL

2004-06-14 Thread Tom Lane
s to be simultaneously equal to all three. So this test certainly fails at every row of CPA. Perhaps you meant "= ANY"? regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] query with =ALL

2004-06-14 Thread Tom Lane
the cur_paralelo or nothing. You're not expressing yourself clearly, because as far as I can understand you there are guaranteed to be no such results. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will igno

Re: [SQL] use of a composite type in CREATE TABLE?

2004-06-17 Thread Tom Lane
Hannes Korte <[EMAIL PROTECTED]> writes: > does anyone know how it is posible to set a composite type as the data > type of a column when creating a new table? Use 7.5 ;-). It's not supported in any existing release, but it does work in CVS tip ...

Re: [SQL] plpgsql - Insert from a record variable?

2004-06-19 Thread Tom Lane
from foo where id = $1; r.f1 = ''baz''; insert into foo select r.*; return; end' language plpgsql; regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] In 7.4 ensure you have DEFAULT now () with no spaces

2004-06-19 Thread Tom Lane
es punctuation. So probably what was really at stake was default 'now()' (wrong because a string literal) versus default now() (correct because a function call). regards, tom lane ---(end of broadcast)---

Re: [SQL] subselect prob in view

2004-06-21 Thread Tom Lane
N. Note that if you are using a pre-7.4 release this could have negative effects on performance --- see the user's guide concerning how explicit JOIN syntax constrains the planner. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] plpgsql - Insert from a record variable?

2004-06-21 Thread Tom Lane
an probably handle this; I'm less sure about plperl or plpython. (No reflection on the languages, but pltcl has the most complete Postgres interface.) regards, tom lane ---(end of broadcast)--- TIP 3: if posting/readi

Re: [SQL] subselect prob in view

2004-06-22 Thread Tom Lane
ich to use. But with outer joins there's a big difference. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so th

Re: [SQL] Non-standard function names

2004-06-23 Thread Tom Lane
lution here; maybe both LOGE and LOG10 could be provided, at > least there would then be only one difference from the JDBC standard. loge() strikes me as pointless; you might as well just use ln(). I don't have any objections to the other proposed additions though.

Re: [SQL] ERROR: Unable to format timestamp; internal coding error

2004-06-23 Thread Tom Lane
I inserted > this timestamp into, I get the following error : > ERROR: Unable to format timestamp; internal coding error FWIW, this is fixed in 7.4 and later. > Is there a way to select the values in the table? I'd try something like UPDATE table SET ... WHERE timestamp >

Re: FW: [SQL] "=" operator vs. "IS"

2004-06-29 Thread Tom Lane
n any case, few people like to depend on such a thoroughly nonstandard behavior ... regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail comman

Re: [SQL] Unrecognized node type

2004-06-29 Thread Tom Lane
that you didn't show us. > My question is simple: what the h... can I do? :-) As far as finding the bug, you need to provide a complete, self-contained test case. As far as loading the schema, how about just removing the DEFAULT clauses? "default null" is the default beh

Re: [SQL] UPDATE ... WHERE (subselect on the same table)

2004-06-29 Thread Tom Lane
you can't express today. > Q2, vital. Can I be sure that the syntax I used here will work > correctly, i.e. will the "test.name" always refer the column in outer > table, not inner (t2)? Yes. The alias *completely* hides the real name of that table referenc

Re: [SQL] Unrecognized node type

2004-06-30 Thread Tom Lane
ver part of the EJB code is breaking ought to know that, because for sure it is SQL-standard behavior. But the JDBC people might be more responsive to a bug report.) regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] quoting

2004-07-01 Thread Tom Lane
ql-hackers archives concerning "dollar quoting". 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 y

Re: [SQL] best method to copy data across databases

2004-07-02 Thread Tom Lane
de a column list in its COPY commands, so a plain pg_dump should work. The way with COPY will be a good bit faster than a pile of INSERT commands. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore yo

Re: [SQL] Custom type where not all elements are comparable

2004-07-05 Thread Tom Lane
d probably handle DISTINCT using hash aggregation, as long as equality behaves sanely; but that's not implemented now.) Probably it'd be reasonable for the comparison operators to return NULL for a noncomparable pair of inputs. regards, tom lane -

Re: [SQL] Immutable function in index

2004-07-06 Thread Tom Lane
You're trying to use a 7.4 feature in 7.3. Multiple functional columns in one index is new in 7.4. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subsc

Re: [SQL] Problem in age on a dates interval

2004-07-16 Thread Tom Lane
cause I see that age() still acts this way in CVS tip. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] [JDBC] [ADMIN] Migrate postgres databases from SQL_ASCII to UNICODE

2004-07-17 Thread Tom Lane
50 and was inserted without complains in a Postgres 7.3.6 with > SQL_ASCII. Ugh. You'll have to work out how to convert that codepage to one of the encodings that PG supports. Or else add it as a supported encoding (I'm not sure how hard that is, but it's not out of

Re: [SQL] C++ interface problem with libpq.so.3

2004-07-19 Thread Tom Lane
asleep. Looks to me like it's just waiting for a response from the backend. I'd suggest looking into what the backend is doing. I doubt you have an "interface" problem at all... regards, tom lane ---(end of broadcast)

Re: [SQL] immutable function calling stable function

2004-07-21 Thread Tom Lane
k in the archives you'll find cases where creating an immutable wrapper function was the recommended solution to performance problems. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desi

Re: [SQL] LIKE on index not working

2004-07-22 Thread Tom Lane
like lower('z'); QUERY PLAN -- Index Scan using fooeyi on fooey (cost=0.00..17.08 rows=5 width=32) Index Cond: (lower((f1)::text) = 'z'::text) Filter: (lower((f1)::text) ~~ 'z'::text) (3 rows)

Re: [SQL] Converting a plperlu function to a plpgsql function

2004-07-22 Thread Tom Lane
regression=# select substring('foobar' from 'o(.)a'); substring --- b (1 row) You'd have to use it twice to collect two separate substrings, which is mildly annoying, but it's hard to see how to do better without bizarre behind-the-scenes st

Re: [SQL] surrogate key or not?

2004-07-23 Thread Tom Lane
do miskey them and then expect to be able to fix the error later. As Achilleus' nearby story shows, you can have these problems (certainly the misentry part) even with imported data that is allegedly someone else's primary key; part numbers, USA social-security numbers, e

Re: [SQL] Is a backend id or something available for use as a foreign key?

2004-07-24 Thread Tom Lane
k in that part of the documentation. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Trigger functions with dynamic SQL

2004-07-24 Thread Tom Lane
bit painful to use. You might want to look at pltcl instead, which is much friendlier to dynamically generated queries (since that's the only way it does things). Of course, if you've never used Tcl there'll be a bit of a learning curve :-( regards,

Re: [SQL] Trigger functions with dynamic SQL

2004-07-24 Thread Tom Lane
27;'''key'''' ''; which is already getting painful, and more complex cases get rapidly worse. With dollar quoting you can write the constant parts of your query the same way you normally would. > What about writing trigger functions in

Re: [SQL] SELECT from a list

2004-07-25 Thread Tom Lane
but of limited understanding of regexes in the planner. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] regex engine

2004-07-25 Thread Tom Lane
ght to get fixed eventually, but claiming it doesn't handle UTF8 at all is simply wrong. regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] How to create an aggregate?

2004-07-30 Thread Tom Lane
array_to_string($1, '|') regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Tom Lane
;t work properly. It returns the rows of the > first query ordered and then appends the rows of the second query > ordered. Pray tell, what Postgres release are you using? AFAICT this will result in an overall sort in all PG releases since 7.0. I don't have anything older to test...

Re: [SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Tom Lane
s that you are misinterpreting the sorting result you get. If you are using a non-C locale you may be seeing some pretty weird sorting rules :-( regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usen

Re: [SQL] Datetime

2004-08-03 Thread Tom Lane
tatypes except text/varchar/char ... regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Datetime

2004-08-03 Thread Tom Lane
ggesting that PG doesn't use a seconds-from-epoch form at all, but some other format (such as perhaps separate /mm/dd/hh/mm/ss fields). Sorry if I added to the confusion instead of dispelling it. regards, tom lane ---(end of broadcast)---

Re: [SQL] SQL syntax extentions - to put postgres ahead in the race

2004-08-06 Thread Tom Lane
(select class, student from grades order by class, student) ss order by class; It looks like (at least in CVS tip) planner.c will take into account the relative costs of doing a GroupAgg vs doing a HashAgg and re-sorting, but I'm too tired to try it right now... re

Re: [SQL] SQL syntax extentions - to put postgres ahead in the race

2004-08-06 Thread Tom Lane
until we find time to make that happen. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Grouping by week

2004-08-06 Thread Tom Lane
o bite you in the past. 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])

Re: [SQL] reply to setting

2004-08-07 Thread Tom Lane
It works fine for the rest of us. Fix your mail software. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

<    8   9   10   11   12   13   14   15   16   17   >