Re: [SQL] Maybe a Bug, maybe bad SQL

2001-03-21 Thread Tom Lane
ract a pretty useful description of all the options majordomo supports (there are a lot of 'em these days). regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [SQL] Error when selecting rows from a temporary table in ODBC

2001-03-21 Thread Tom Lane
dn't exist before > the execution. More to the point, the later SELECTs are probably being parsed with regard to the previous versions of tmp_cr and tmp_db that existed at the start of the line. This is fixed in 7.1, but in previous releases you'd best split up that sequence of operat

Re: [SQL] FULL JOIN

2001-03-21 Thread Tom Lane
"Ligia Pimentel" <[EMAIL PROTECTED]> writes: > Does anyone know if it is possible to make a FULL OUTER JOIN in Postgres 7? In 7.1. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] creating "job numbers"

2001-03-23 Thread Tom Lane
at all if you build your system like that. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] Btree index on varchar

2001-03-23 Thread Tom Lane
, but I'd guess that the net effect would be relatively small. Really what you want to be asking yourself is which columns do you need an index on for your query logic. What datatype they are is a minor consideration. regards, tom lane ---(end o

Re: [SQL] how do I check if a temporary table exists?

2001-03-24 Thread Tom Lane
ractable thing to deal with than mappings of individual temp table names. 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

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
18887 (1 row) shows that the above view's reference to int8_tbl isn't broken. Of course you'll need to be superuser to do the UPDATE on pg_rewrite, and you will probably find that you need to quit and restart the backend before it will use the changed view definition. Good luck! regards, tom lane PS: Yes, I know we gotta fix this... ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
ide PL functions, for example. 2. An ALTER VIEW command that lets you change a view's defining query, while keeping the same OID, as long as the names and types of the output columns don't change. This would reduce the need to drop and recreate views. regard

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
portion of the original query string that corresponds to the body of the CREATE RULE/VIEW command. But that could be fixed with some straightforward hacking... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] CHAR or VARCHAR

2001-03-25 Thread Tom Lane
"Peter J. Schoenster" <[EMAIL PROTECTED]> writes: > On 22 Mar 2001, at 10:05, Tom Lane wrote: >> There is *no* performance advantage of CHAR(n) over VARCHAR(n). > I wonder if this question of char/varchar is postgresql specific or > rdbms in general. It's de

Re: [SQL] Function Vanished

2001-03-26 Thread Tom Lane
s more than a couple K then the text will be compressed and difficult to spot or extract. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] Function Vanished

2001-03-26 Thread Tom Lane
ings(1) on the pg_proc table, which will be ... hmm ... $PGDATA/base/YOURDBOID/1255. Look in pg_database if you're not sure of the OID of the database you are using. If you have not vacuumed then the latest version of the row will be the one closest to the front of

Re: [SQL] Upgrading from 6.2 to 7

2001-03-27 Thread Tom Lane
version), initdb, reload. Long version: Great Bridge's docs explain upgrading in excruciating detail ;-). You can download PDFs for free from http://www.greatbridge.com/docs/ regards, tom lane ---(end of broadcast)--- TI

Re: [SQL] Replace into...?

2001-03-27 Thread Tom Lane
a "clean" way to implement this feature in postgresql? > I really don't want my applications to have to know what indexes are in > place for a given table. I'm confused. What does "replace into" have to do with having to know what indexes are in place?

Re: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-27 Thread Tom Lane
me as essentially bogus in any case... regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

[HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-27 Thread Tom Lane
ELECT and SELECT FOR UPDATE have different visibility rules, so you probably don't want to intermix them. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

[HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-27 Thread Tom Lane
add FOR UPDATE to that final SELECT? You're right, the initial SELECT FOR UPDATE is a waste of cycles considering that you're not using the value it returns. But you'll still need the last select to be FOR UPDATE so that it plays by the same rules as the UPDATE does.

Re: [SQL] DELETE FROM fails with error

2001-03-28 Thread Tom Lane
correct way of quoting a mixed-case field name. I think the field is not named quite like you think it is. Try doing pg_dump -s -t tblshop databasename to see what the field names really are. regards, tom lane ---(end of broadcast)

Re: [SQL] counting distinct rows on more than one column

2001-03-28 Thread Tom Lane
Dirk Lutzebaeck <[EMAIL PROTECTED]> writes: > on 7.0.3 want to COUNT > SELECT DISTINCT a,b FROM t; In 7.1 you could do select count(*) from (select distinct a,b from t) as t1; In 7.0 and before I think you have no choice but to use a temp table.

Re: [SQL] Function with now() | time 'now' | etc...

2001-03-28 Thread Tom Lane
t change value inside a transaction. See http://www.postgresql.org/devel-corner/docs/postgres/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensiv

Re: [SQL] counting distinct rows on more than one column

2001-03-28 Thread Tom Lane
e character you never use in column A, say '|', you could do count(distinct(a || '|' || b)) with some safety, but this strikes me as still a pretty fragile approach. regards, tom lane ---(end of broadcast)--

Re: [SQL] Can a SELECT block?

2001-03-28 Thread Tom Lane
open transaction started. But offhand I think it does not matter for anything else. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command

Re: [SQL] Escaping \

2001-03-29 Thread Tom Lane
ros: You need an extra level of quoting because the function body is itself a string literal. You might find the quoting discussion in http://www.postgresql.org/devel-corner/docs/postgres/plpgsql-porting.html helpful. regards, tom lane ---(end of b

Re: Calling Java from psql (was Re: [SQL] requesting help)

2001-03-29 Thread Tom Lane
be easy to implement, but that doesn't make it a good idea. 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])

[GENERAL] Re: [SQL] inconsistent functionality with LIKE operator

2001-03-29 Thread Tom Lane
es. The string-literal parser eats one level of backslashes, but you need the pattern that arrives at LIKE to look like "a\\b%". BTW, "PostgreSQL version 7.1" does not exist yet. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-29 Thread Tom Lane
o full release cycles --- therefore, it can wait another cycle for a fix that has been considered, reviewed, and tested. Let's not risk making things worse by releasing a new behavior we might find out is also wrong. regards, tom lane ---(end o

Re: [SQL] Possible 7.1RC1 bug

2001-03-30 Thread Tom Lane
regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-30 Thread Tom Lane
d test a fix in the early part of the 7.2 development cycle, and then back-patch it into a 7.1.x release perhaps 2 or 3 months from now. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Use

Re: [SQL] Possible 7.1RC1 bug

2001-03-30 Thread Tom Lane
ws & functions. Is > there a setting that can change this back to the "regular" behavior of > sum(integer) = integer? Sorry, no. You can coerce the result back to int4 if you care to risk overflow: "select sum(int4field)::int4" or some such.

Re: [SQL] Vacuum Error

2001-03-31 Thread Tom Lane
Error: ERROR: VACUUM (repair_frag): FlushRelationBuffers returned -2 I believe this is fixed in 7.1RC1. Leastwise, one possible cause of this message is fixed in RC1 ;-) regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and

Re: [SQL] ON DELETE rule

2001-04-01 Thread Tom Lane
zas. You appear to be envisioning one firing per tuple deleted. I'd recommend doing the UPDATE inside a trigger instead. That approach will operate in the way you envision. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] using for rec inside a function: behavior very slow

2001-04-02 Thread Tom Lane
hen the plan is created. In 7.1 you can work around this problem by using plpgsql's FOR ... EXECUTE notation, but I don't think there's any good answer in 7.0. for rec in execute ''select id,url from urlinfo where url like ''||quote_litera

Re: [SQL] very very slow .....

2001-04-02 Thread Tom Lane
ce. You'll need to provide some details about the problem queries and the plans you get for them in 6.5 and 7.0. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] pg_dumpall and password access

2001-04-03 Thread Tom Lane
s up even more. See the admin documentation for more info. I don't recommend using IDENT for connections from untrusted machines, but on localhost it's as trustworthy as your local sysadmin... regards, tom lane ---(end of broadcast)-

Re: [SQL] max( bool )?

2001-04-04 Thread Tom Lane
NOTICE: Buffer Leak: [059] (freeNext=54, freePrev=58, relname=tblstsc1, > blockNum=0, flags=0x14, refcount=-4 -1) (a) What Postgres version is this? (b) Could we see the schemas for the tables? (pg_dump -s output is the best way) regards, tom lane --

[SQL] Re: Query broken under 7.1RC2

2001-04-04 Thread Tom Lane
rouped query, and so references to the ungrouped h.* columns in the SELECT targetlist are not well defined. Lord knows what result you were getting from 7.0 ... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Strategy for unlocking query

2001-04-04 Thread Tom Lane
rotocols and isn't under our control). > What is the best way of dealing with this problem as I ended up stopping and > restarting the postmaster? It would've been sufficient to find and SIGTERM the individual backend from the lost session. regards, to

Re: [SQL] Historical dates in Timestamp

2001-04-04 Thread Tom Lane
stamp; ?column? - 0012-05-28 00:00:00 (1 row) regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] performance of functions - or rather lack of it

2001-04-04 Thread Tom Lane
optimisations by pre-parsing the SQL ? Unless your TCP connection is running across tin cans and string, the transfer time for the query text is negligible ... regards, tom lane ---(end of broadcast)--- TIP 2: you can get o

Re: [SQL] Need to do an ALTER TABLE.

2001-04-04 Thread Tom Lane
oreign key references? If not automatically, will VACUUM ANALYZE do > this for me? No, and no :-(. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] max( bool )?

2001-04-04 Thread Tom Lane
OTICE :-(. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] UNION in a VIEW?

2001-04-04 Thread Tom Lane
7;t gotten round to convincing myself about whether that transformation is always valid, or what conditions it needs to be valid. A TODO item for some future release... regards, tom lane ---(end of broadcast)--- TIP 6: Have yo

Re: [SQL] [7.0.3] optimizing a LIKE query ...

2001-04-04 Thread Tom Lane
ks is right anyway). The real problem is the planner thinks that LIKE '%http://www.postgresql.org/%%' is really selective; it has no idea that most of your table mentions pgsql.org URLs :-(. We need better statistics to fix this properly. (On my list for 7.2.)

Re: [SQL] Memory and performance

2001-04-04 Thread Tom Lane
| group 2 | 00:00:03 3 | group 3 | 00:00:03 4 | group 4 | 00:00:03 5 | group 5 | 00:00:03 6 | group 6 | 00:00:03 7 | group 7 | 00:00:03 8 | group 8 | 00:00:03 9 | group 9 | 00:00:03 10 | group 10 | 00:00:03 (10 rows) regards, tom lane

Re: [SQL] performance inconsistency

2001-04-04 Thread Tom Lane
of a less appropriate plan. Hard to tell without seeing what EXPLAIN has to say, though. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Memory and performance

2001-04-05 Thread Tom Lane
rtMem parameter (backend -S switch) set to? That's about the only use I can think of for RAM beyond what's needed to cache the whole database ... regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscr

Re: [SQL] how to do this join ?

2001-04-06 Thread Tom Lane
(new in 7.1): select zylinder.*, a_typ as typ, a_t_definition_d as text from (zylinder left join auftrag on (a_nr = z_a_nr)) left join auftrags_typ on (a_t_code = a_typ); regards, tom lane ---(end of broadcast)--- TIP

Re: [SQL] "row_count" reserved?

2001-04-06 Thread Tom Lane
n run from PSQL. Huh? row_count is a keyword in plpgsql ... not sure how long it's been a keyword ... regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] Re: Update

2001-04-12 Thread Tom Lane
st of evaluation for functions, but it's not being used for anything ... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Sql error

2001-04-12 Thread Tom Lane
"comp" <[EMAIL PROTECTED]> writes: > but after connection when I type testdb=3D>\df it gives this error: > " ERROR: Function 'oid8types(oidvector)' does not exist. Use the version of psql that came with 7.0.3, not some older version.

Re: [SQL] Full outer join

2001-04-13 Thread Tom Lane
ion are you using? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Full outer join

2001-04-13 Thread Tom Lane
't marked mergejoinable, but plain old int certainly doesn't have that problem. I think there's something you haven't told us. Is either of these tables actually a view? regards, tom lane ---(end of broadcast)---

Re: [SQL] Full outer join

2001-04-13 Thread Tom Lane
Tim Perdue <[EMAIL PROTECTED]> writes: >> Is either of these tables actually a view? > Hehe - no. I sent the \d of both tables at the bottom of that email. \d isn't very helpful for these sorts of reports. How about pg_dump -s ?

Re: [SQL] 7.1 grant/revoke speed

2001-04-13 Thread Tom Lane
is with the grants/revokes per se; probably the slowdown is elsewhere. Have you looked for changes in the EXPLAIN results for the queries being used? regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Mailing list gripes (was Re: [SQL] Re: Maybe a Bug, maybe bad SQL)

2001-04-13 Thread Tom Lane
lly I'd vote for losing them altogether... > I wish people could also lose the preaching in their signatures. Amen, brother ;-) regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FA

Re: [SQL] RE: RE: Re: select substr???

2001-04-13 Thread Tom Lane
null input, rather a null result will be assumed automatically --- with much less overhead than an explicit test for null would need. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once wit

Re: [SQL] Calling plSQL functions

2001-04-13 Thread Tom Lane
thinks it's useless, because you're discarding the result. (I think that plpgsql is being overly anal-retentive about it, since such a query might indeed be useful if you then examine FOUND or ROW_COUNT, but that's the issue at the moment.) Try making it a SELECT INTO instead.

Re: [SQL] Calling plSQL functions

2001-04-13 Thread Tom Lane
the second need. For the first, perhaps use the FOR ... loop construct in plpgsql. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Bug in user management?

2001-04-13 Thread Tom Lane
ruser status. You are laboring under a severe misapprehension if you think that epi has ANY restrictions on what he can do ... regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] BOOLEAN data type?

2001-04-14 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Can someone explain this to me? Are you taking into account that SQL booleans are actually three-valued? They can be TRUE, FALSE, or NULL (NULL taken as meaning "don't know"). regards, tom lan

Re: [SQL] Full outer join

2001-04-14 Thread Tom Lane
'll appear in 7.1.1, or you can grab CVS or a nightly snapshot if you are in a hurry. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] RTREE on points

2001-04-16 Thread Tom Lane
er to develop a GIST opclass instead of rtree. In the long run I suspect GIST will be better supported than rtree, since it's more general. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through U

Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Tom Lane
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

[SQL] Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Tom Lane
erted into has no foreign keys? regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] RTREE on points

2001-04-17 Thread Tom Lane
the maillist archives, but www.postgresql.org is too friggin' slow at the moment ... regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] RTREE on points

2001-04-17 Thread Tom Lane
Jeff Hoffmann <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> How the heck did the GIST index code get developed/tested without some >> opclasses? > doing some digging at berkeley, i found the original pggist patch file > that created the gist access method &a

Re: [SQL] is this proper sql?

2001-04-17 Thread Tom Lane
according to the SQL92 spec, but we don't support that (yet). 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] Subqueries in select clause

2001-04-18 Thread Tom Lane
Time to update to 7.1... regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Tom Lane
ws have a lot of problems in that version, and one of the problems is that you can't do another level of aggregating on their results. Basically a view and a subselect are the same thing, so you can't get around the restrictions of one by using the other... 7.1 is what Sara needs.

Re: [SQL] creating tables that are visible across databases

2001-04-20 Thread Tom Lane
It looks to me like some of the uses of IsSharedSystemRelationName could/should be replaced by examining pg_class.relisshared, but in other places it's really necessary to determine sharedness with nothing but a relname to go on. This will all need to be rethought when we implement schemas, anyway

Re: [SQL] pg_dump bug? (7.1)

2001-04-23 Thread Tom Lane
Cedar Cox <[EMAIL PROTECTED]> writes: > When I try to run pg_dump I get a segmentation fault. This only seems to > happen if the PGDATABASE environment variable is set and I don't supply > the database name on the command line. Fixed.

Re: [SQL] Problems handling errors in PL/pgSQL

2001-04-23 Thread Tom Lane
returns the return value for the function and no error. But how would KPSQL know what value the function might have returned? Something fishy here ... did you check the postmaster log to see whether an error is really being reported or not? regards, tom lane

Re: [SQL] using top-level aggregate values in subqueries

2001-04-23 Thread Tom Lane
d version of my example While it's not a general solution, there's always transitivity: select f.id from foo f, ola o where f.id = ( select max( b.id ) from bar b where b.bling = "i kiss you!" ) and o.id != f.id regards, tom

Re: [SQL] Table corrupted and data lost (second time in one month!!)

2001-04-25 Thread Tom Lane
"J.Fernando Moyano" <[EMAIL PROTECTED]> writes: > The postgres version is 7.0.2 ... I'd suggest an update to 7.1 ... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Regexps -- too complex?

2001-04-26 Thread Tom Lane
"Emils Klotins" <[EMAIL PROTECTED]> writes: > Running 7.0.2 on Alpha/RedHat 6.2 256MB RAM Update to 7.1. 7.0.* has a lot of portability problems on Alphas, and one of them is that regexps with between 33 and 64 states don't work (int vs long problem...)

Re: [SQL] simulate union in subselect

2001-04-26 Thread Tom Lane
e > order by date; What gives you the idea that this doesn't work? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] No JOINs in UPDATE ... FROM?

2001-04-26 Thread Tom Lane
::= UPDATE SET [ WHERE ] Postgres allows the clause, but treats it as supplying *additional* table references besides the target table reference. Thus the error. In other words: you can JOIN, but not against the target

Re: [SQL] How to encode and decode password in pgsql !!

2001-05-03 Thread Tom Lane
inappropriately in committing a new-feature item before we'd made the branch for 7.2 development. But I don't have the time to argue about it... regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] '13 months ago'::reltime

2001-05-03 Thread Tom Lane
Type reltime is old and deprecated. Don't use it. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere&

Re: [SQL] create table

2001-05-04 Thread Tom Lane
it'd not be clear how far the alternatives are supposed to extend. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL P

Re: [SQL] Dateadd

2001-05-05 Thread Tom Lane
tors that're clearly marked as MS-SQL-isms. But I don't think we'd do the world any favor by adopting a clearly nonstandard notation as part of our standard operator set. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] update error

2001-05-06 Thread Tom Lane
"guard" <[EMAIL PROTECTED]> writes: > update table_a set trn_no = table_b.trn_no from table_a,table_b > where table_a.cust_no=table_b.cust_no > IN pgsql 7.0x IS OK > if run 7.1 IS error ?? More details please? regards, tom lane --

Re: [SQL] no more pg_dump cause of multiple declared database??

2001-05-09 Thread Tom Lane
want to own that database. (You will then have to find the objects he *should* own, and fix their owner ID values...) There should be a unique index on pg_shadow.usesysid, but due to an old oversight there isn't. Fixing this is on the TODO list. regards, tom lane

Re: [SQL] Escape Quotes

2001-05-10 Thread Tom Lane
Keith Gray <[EMAIL PROTECTED]> writes: > Is it possible to get/configure PostgreSQL to handle > as within a dleimited string? We already do. regression=# select 'O''SHEA'; ?column? -- O'SHEA (1 row) regards, tom lan

Re: [SQL] Escape Quotes

2001-05-10 Thread Tom Lane
Keith Gray <[EMAIL PROTECTED]> writes: > This may be a problem in "ipgsql" then?? I guess. What is that, anyway? > ...or is it different in update from select? Nope, a literal is a literal. regards, tom lane --

Re: [SQL] Using ORDER BY with AGGREGATE/GROUP BY in a SELECT statement

2001-05-11 Thread Tom Lane
FROM race r2 WHERE r2.personid = r.personid ORDER BY r2.date DESC LIMIT 1) AS carid so that the result tracks the outer query, and in this form it'd be redone once per output row. regards, tom lane --

Re: [SQL] Re: multi-table join, final table is outer join count ...

2001-05-12 Thread Tom Lane
a match. In your above example, I'm not sure whether it's right to put i.active in the ON part or in WHERE. It depends on what you want to happen for status rows that match only inactive images, and whether you consider them different from status rows that match

Re: [SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-12 Thread Tom Lane
r order. But the Unique filter needs to see its inputs in order by the fields being made unique. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] SELECT timestamp('2001-06-12'::date - '2000-06-12'::date)

2001-05-12 Thread Tom Lane
ate - '2000-06-12'::date; ?column? -- 365 (1 row) > performance=# SELECT timestamp('2001-06-12'::date - '2000-06-12'::date); >timestamp > > 1970-01-01 01:06:05+01 > (1 row) timestamp(integer) converts a Unix timestamp val

Re: [SQL] Problem using IP functions

2001-05-12 Thread Tom Lane
n its output, which it shouldn't oughta have done. You can't see the null from outside the system, but it manages to mess up text comparisons anyway. BTW, you should consider using inet or cidr datatype for that column rather than varchar... regards, tom lane --

Re: [SQL] DISTINCT ON () with UNION

2001-05-13 Thread Tom Lane
[EMAIL PROTECTED] writes: > How can you use a distinct on () including the whole union. In 7.1 you can write select distinct ... from (select ... union select ...) ss; regards, tom lane ---(end of broadcast)--- TIP 3:

Re: [SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-14 Thread Tom Lane
ing the sort order. The outer path's ordering is preserved only in relatively small test cases... regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] How NULL is interpreted in Pgsql

2001-05-15 Thread Tom Lane
e one. See any discussion of SQL NULLs --- Bruce's book talks about this IIRC, or we've been over the turf more than once in the mailing list archives. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checke

Re: [SQL] Select most recent record?

2001-05-16 Thread Tom Lane
"Marc Sherman" <[EMAIL PROTECTED]> writes: > I'd like to select the newest (max(timestamp)) row for each id, > before a given cutoff date; is this possible? select * from log order by timestamp desc limit 1; regards, tom lane -

Re: [SQL] Select most recent record?

2001-05-16 Thread Tom Lane
id, timestamp desc; See the SELECT reference page for more about this. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Setting session global variables

2001-05-16 Thread Tom Lane
temp table name would refer to a different table in each session. (You realize, of course, that CURRENT_USER already exists per SQL spec. I assume you just meant that you'd like to have things *like* CURRENT_USER, but defined by yourself...)

Re: [SQL] has anyone tried running in MAC OS X

2001-05-17 Thread Tom Lane
her trying with earlier releases. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] Inherited tables: How stable is that feature?

2001-05-18 Thread Tom Lane
now allows update/delete over inheritance hierarchies, which never worked before --- that doesn't look like a dying feature to me. I would not really recommend using multiple inheritance, but single inheritance seems like a safe-enough bet. regards, tom lane -

Re: [SQL] are NEW and OLD rule attributes broken?

2001-05-18 Thread Tom Lane
viously :-(). It would be fairly difficult to change, anyway. > How can I get the result I want? If you want to copy the data actually inserted, a trigger is a much better bet than a rule. regards, tom lane ---(end of broadcast)

Re: [SQL] Select question

2001-05-23 Thread Tom Lane
ry as where cdate > 1978 (result of integer subexpression) and then doing some weird integer-to-date conversion. In general, any constant of a non-numeric datatype needs to be quoted in SQL queries. regards, tom lane ---(end of broadcast)---

<    1   2   3   4   5   6   7   8   9   10   >