[SQL] Subselect in join?

2000-11-29 Thread Kenn Thompson

Ok- Seems I've seen this somewhere, but can't seem to get it to work. Is my memory 
flawed, or is this just not an implemented feature?

SELECT * FROM (SELECT foo, bar FROM tfoobar)

In english- is it not possible to to a subselect in a FROM clause?

Kenn


____
Kenn Thompson
Senior Web Architect
Adesta Communications
Work: 402.233.7595
Cell: 402.210.6326





RE: [SQL] SQL parse error

2000-12-12 Thread Kenn Thompson

All-


While it is not always the case, I see many responses to questions in the form of "Why 
don't you just upgrade- that's supported in version XXX".

Let me give you several reasons why this is not always possible.

1. Support software is not compatible.
   I use Chili!soft for Linux, a webpage/asp solution. Even tho I use the most current 
version of Chili!Soft, it currently only supports Postgresql 6.5.2. I don't have the 
option of upgrading. My DB is used by this software, so I would break the dependancy 
if I upgraded.

2. DB Users may not be DBAs.
  If a user is not responsible for the maintenance of the server or the software 
running on it (such as a third party ISP or IS department), upgrading is not a choice. 
While suggestions can usually be made, the user is not at liberty to make it happen.

Being that this is an SQL forum for help, it seems appropriate that any reply for 
assistance should be directed towards the version is use. This is not intended to be a 
flame against this particular reply, just an observation is general. While stating the 
version that a particular solution is available is not completely inappropriate, every 
attempt should be made to offer help in the version that is being presented by the 
request.


Sorry if this seems long-winded- it just seems that someone needed to say it...

Kenn


____
Kenn Thompson
Senior Web Architect
Adesta Communications
Work: 402.233.7595
Cell: 402.210.6326


>>> "Francis Solomon" <[EMAIL PROTECTED]> 12/12/00 04:21AM >>>
Hi Borek,

What version of PostgreSQL are you using? This works fine for me on
7.02. Time to update, maybe?

Hope this helps

Francis

>
>Hello all,
>
>My following problem is:
>
> swports=# select substring(cp from 1 for 4)::int4 from out2cp;
> ERROR:  pg_atoi: error in "6.1,": can't parse ".1,"
>
>SQL syntax is apparently OK. When I omit the typecast, the query
> works:
>
> swports=# select substring(cp from 1 for 4) from out2cp;
>  substr
> 
>  3182
>  3182
>  3182
> -8<- text deleted ---
>
>The cp entries are varchars in form .N, where N is numeral.
>So can someone explain why the parse error?
>





Re: [SQL] realising a counter in an pgpsql-trigger

2001-04-26 Thread Kenn Thompson

Hate to be entirely off topic, but can anyone help me with changing to digest version 
of the listserv subscription? I've been all over the site, and can't find the 
instructions.

>>> chris G*nther <[EMAIL PROTECTED]> 04/26/01 09:17AM >>>
Hi folks,

I want to do the following: I have a column in every table, named c_update, it's
purpose is to hold how many times the dataset was updated. This should be done
automatically by the trigger - which already set sthe update-user, -time and date.
How can I do this ???

chris

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl


---(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] moving DB

2000-06-06 Thread Kenn Thompson

Related to this- how do you accomplish the same this while preserving the existing 
OIDs?

>>> Christopher Sawtell <[EMAIL PROTECTED]> 06/06/00 02:33AM >>>
On Sat, 12 Jul 2036, [EMAIL PROTECTED] wrote:
> Hi all!
> 
> well, can somebody tell me how to move a DB (e.g. I have a DB named  NET in
> PC1 under pg6.5.3 and I want to put it in PC2 under pg7.0)
> should I copy just the data/base/NET/ directory and the paste it in the
> data/base of the PC2...

No, No, don't do that.
pg7.x cannot read databases created by pg6.5.3

> which are the exactly steps...
> 
> :o) thanx

use pg_dumpall on PC1 and then read it back in on the other system.

pg_dumpall -o > db.out   # on PC1

move the db.out file to PC2 in whatever way is appropriate.

psql -e template1 < db.out   # on PC2

-- 
Sincerely etc.,

 NAME   Christopher Sawtell - iOpen Technologies Ltd.
 CELL PHONE 021 257 4451
 ICQ UIN45863470
 EMAIL  chris @ iopen . co . nz,  csawtell @ xtra . co . nz
 WWWhttp://www.iopen.co.nz 
 CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz 

 -->> Please refrain from using HTML or WORD attachments in e-mails to me <<--





[SQL] Problem with pg_dumpall in reverse

2000-06-27 Thread Kenn Thompson

Ok- this may be a simple answer, but-

Once the database has been dumped, how do you restore while keeping the original OIDs? 
I've used the OID as a unique key that ties records together, and somehow they don't 
go back together nicely...

doing a dump with "pg_dumpall -o -c > db.out"
restoring with "cat db.out | psql"

Thanks,
Kenn 

>>> Ryan Bradetich <[EMAIL PROTECTED]> 06/27/00 11:27AM >>>
Hello all,

I am having a new problem with pg_dumpall that I have not seen before.
I've been
browsing the documentation and could not find anything related to this
problem.  Any
ideas or pointers would greatly be appreciated.

boi260 sanity $ /opt/pgsql/bin/pg_dumpall -v -o | /usr/contrib/bin/gzip
-c > /opt/pgsql/backup/db.pgdump.gz

[ Extra verbage snipped ]

--  dumping out the contents of Table 'medusa'
FATAL 1:  Memory exhausted in AllocSetAlloc()
PQendcopy: resetting connection
SQL query to dump the contents of Table 'medusa' did not execute
correctly.  After we read all the table contents from the backend,
PQendcopy() failed.  Explanation from backend: 'FATAL 1:  Memory
exhausted in AllocSetAlloc()
'.
The query was: 'COPY "medusa" WITH OIDS TO stdout;
'.
pg_dump failed on procman, exiting






procman=# select version();
version
---
 PostgreSQL 7.0.0 on hppa2.0w-hp-hpux11.00, compiled by gcc 2.95.2
(1 row)


Thanks,

- Ryan