Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
Scott Marlowe wrote: > Would it be possible if we required postfix operators and related to > be inside parens? > > select x ~~ y as yabba > OR > select (x ~~ y) yabba That's pretty much what you get if you restrict the expression to c_expr. -- Peter Eisentraut http://developer.postgresql.org/~

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
Tom Lane wrote: > I think it's a big stretch to say that that patch fixes it, since it > only allows an AS-less target expression to be c_expr rather than > a_expr as it ought to. Well, it works for a useful subset. I remember that some other database did not *allow* the AS, so there were portin

Re: [SQL] Deleting Functions

2006-08-23 Thread Tom Lane
"Jim Buttafuoco" <[EMAIL PROTECTED]> writes: > select 'drop function ' || nspname || '.' || proname || '(' || > pg_catalog.oidvectortypes(p.proargtypes) || ');' from > pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where > nspname='public'; Seems like you could do that more easily with

Re: [SQL] All columns from table in a joined query

2006-08-23 Thread Tom Lane
[EMAIL PROTECTED] writes: > I've been trying to figure out how to do the following: > Select schedule.* from schedule join meetingday on schedule.id = > meetingday.scheduleid where sessionnumber = 165 group by schedule.* order by > min(meetingday.date); I think what you're after is select * fro

Re: [SQL] Deleting Functions

2006-08-23 Thread Jim Buttafuoco
Scott, I use the following query with psql \o option. Change the schema name from public to whatever. I am sure you could put this into a plpgsql function using execute as well. Jim \o drops.sql select 'drop function ' || nspname || '.' || proname || '(' || pg_catalog.oidvectortypes(p.proar

Re: [SQL] All columns from table in a joined query

2006-08-23 Thread Sumeet
You need to create a custom aggregate for this CREATE AGGREGATE array_accum ( sfunc = array_append, basetype = anyelement, stype = anyarray, initcond = '{}' ); then use the field names in your query like this select array_to_string(array_accum(field1 || '@' || field2),'#')

[SQL] Deleting Functions

2006-08-23 Thread Scott Petersen
Folks, I am using PGSQL do do all of my schema changes, but have run into a problem. I need to be able to DROP all of the USER FUNCTIONS that are defined in a schema. The problem is that I do not know the names of all of the functions and parameters. I know that I could use '\df' and then

[SQL] All columns from table in a joined query

2006-08-23 Thread MHahn
I've been trying to figure out how to do the following: Select schedule.* from schedule join meetingday on schedule.id = meetingday.scheduleid where sessionnumber = 165 group by schedule.* order by min(meetingday.date); Is this possible in any way, or do I need to list each field of the schedul

Re: [SQL] SQL92 compliance

2006-08-23 Thread Scott Marlowe
On Wed, 2006-08-23 at 12:40, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: > >> Is AS in "SELECT my_column AS my_name FROM my_table" mandatory to be SQL92 > >> compliant? > > > No. I have a patch at > >

[SQL] The length of the sql query

2006-08-23 Thread Emi Lu
Hello, Just curious to know whether postgresql has any length constraint about where part, such as Query = [ select col1, col2, ... coln from table 1, table2, where constraint1 + constraint2 +constraintN ] Is there any length arrange for the Query str such as

Re: [SQL] SQL92 compliance

2006-08-23 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: >> Is AS in "SELECT my_column AS my_name FROM my_table" mandatory to be SQL92 >> compliant? > No. I have a patch at >

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: > Is AS in "SELECT my_column AS my_name FROM my_table" mandatory to be SQL92 > compliant? No. I have a patch at that fixes this at least for 7.4. I don'

Re: [SQL] error with mor than 1 sub-select

2006-08-23 Thread Erik Jones
Actually, it pointed you right to it. Notice that exits is just before where the pointer was. chrisj wrote: thanks, stupid user error. i guess the pointer on the error message led me astray Michael Fuhr wrote: On Tue, Aug 22, 2006 at 06:47:51PM -0700, chrisj wrote: The first query