Re: [SQL] is limit a reserved keyword?

2000-05-26 Thread Tom Lane
Gabriel Russell <[EMAIL PROTECTED]> writes: > Is limit a reserved keyword? Yes. > If so, then it is not in the list of reserved keywords. Documentation oversight, evidently :-( regards, tom lane

[SQL] is limit a reserved keyword?

2000-05-26 Thread Gabriel Russell
I have a piece of commercial software that does a query like so: CREATE TABLE chargelimits (id int NOT NULL, user_id int NOT NULL, limit float NOT NULL ) but the postgresql 7.0 gives a parse error near "limit". Is limit a reserved keyword? If so, then it is not in the list of reserved keywords. I

[SQL] New Type

2000-05-26 Thread Olivier PRENANT
Hi all, I'm trying to create a type password; the goal is to have a table like: CREATE TABLE test ( username varchar, pass passwd); insert into test values ('me','secret'); and have "secret" being automagicly crypted. What I want is to mimic the PASSWORD function of mysql but much better, not

Re: [SQL] aliases break my query

2000-05-26 Thread Joseph Shraibman
Tom Lane wrote: > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > > These two queries are exactly alike. The first one uses aliases except > > for the order by. The second uses aliases also for the order by. The > > third uses whole names. The third has the behavior I want. > > I think you are

Re: [SQL] aliases break my query

2000-05-26 Thread Joseph Shraibman
Peter Eisentraut wrote: > > > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > > ta.a) from tablea ta, tableb tb order by tablea.a; > > [ produces 80 rows ] > > > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > > ta.a) from tablea ta, tableb t

Re: [SQL] POSTGRESQL and PERL?

2000-05-26 Thread Richard Huxton
- Original Message - From: Ed Loehr <[EMAIL PROTECTED]> To: Peter Landis <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, May 26, 2000 5:35 PM Subject: Re: [SQL] POSTGRESQL and PERL? > Peter Landis wrote: > > > > but what if you have a variable set like: > > $sort_selection = "n

Re: [SQL] POSTGRESQL and PERL?

2000-05-26 Thread Ed Loehr
Peter Landis wrote: > > but what if you have a variable set like: > $sort_selection = "name"; > > How do you sort by the variable? > > For instance you cannot do... > $sqh = $dbh->prepare(q{select name from company order > by $sort_selection;}); Why not? The query string is created before pre

Re: [SQL] aliases break my query

2000-05-26 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Once again, I think that we *really* need to discuss whether implicit > range table entries in SELECT are a good idea. We invariably get a > question like this every week and invariably the answer is "if you give a > table an alias you *must* refer to

Re: [SQL] PG/DBI: 'NOTICE: UserAbortTransactionBlock and not in in-progress state'

2000-05-26 Thread Tom Lane
Markus Wagner <[EMAIL PROTECTED]> writes: > I am using PG 6.5.1 and DBI. My Perl programs always print to stderr: > "NOTICE: UserAbortTransactionBlock and not in in-progress state" or > "NOTICE: EndTransactionBlock and not inprogress/abort state" > I tried to do -> finish and -> commit after eac

RE: [SQL] POSTGRESQL and PERL?

2000-05-26 Thread Wallingford, Ted
Peter my guess is you can just substitute the variable name in for the actual sortfield name.. select * from company order by $field; That's why variables BEGIN with denotation characters in Perl rather than ending with them (like in basic).. Anyway, let me know if that works... and which modul

[SQL] POSTGRESQL and PERL?

2000-05-26 Thread Peter Landis
Hi- I'm a newbie at postgresql and was working on sorting by category. What my question is, how do you sort by category when using a variable. For instance, you can sort by name in perl by doing: $sqh = $dbh->prepare(q{select name from company order by name;}); $sqh->execute(); but what i

Re: [SQL] date() indexing error..

2000-05-26 Thread Tom Lane
"Mitch Vincent" <[EMAIL PROTECTED]> writes: > Using PostgreSQL 7.0 I'm Doing ... > ipa2=# CREATE INDEX "app_stat_month" on applicant_stats(date(month)); > ERROR: SQL-language function not supported in this context. > ipa2=# \d applicant_stats > Table "applicant_stats" > Attribute | Type

[SQL] date() indexing error..

2000-05-26 Thread Mitch Vincent
Using PostgreSQL 7.0 I'm Doing ... ipa2=# CREATE INDEX "app_stat_month" on applicant_stats(date(month)); ERROR: SQL-language function not supported in this context. ipa2=# \d applicant_stats Table "applicant_stats" Attribute | Type| Modifier ---+---+-- app_i

Re: [SQL] PG/DBI: 'NOTICE: UserAbortTransactionBlock and not in in-progress state'

2000-05-26 Thread Ed Loehr
Markus Wagner wrote: > > Hi, > > I am using PG 6.5.1 and DBI. My Perl programs always print to stderr: > > "NOTICE: UserAbortTransactionBlock and not in in-progress state" or > "NOTICE: EndTransactionBlock and not inprogress/abort state" > > I tried to do -> finish and -> commit after each >

Re: [SQL] aliases break my query

2000-05-26 Thread Peter Eisentraut
> > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > ta.a) from tablea ta, tableb tb order by tablea.a; > [ produces 80 rows ] > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > ta.a) from tablea ta, tableb tb order by ta.a; > [ produces 20 rows ]

Re: [SQL] A Question

2000-05-26 Thread Peter Eisentraut
On Fri, 26 May 2000, Sherril Mathew wrote: > My one feild in the database is Date/time I want to find a range of > records which exists between two dates in the same date field in the > database SELECT * FROM table WHERE datetime_field between '1999-03-15' and '2000-10-23'; > Also tell me

[SQL] PG/DBI: 'NOTICE: UserAbortTransactionBlock and not in in-progress state'

2000-05-26 Thread Markus Wagner
Hi, I am using PG 6.5.1 and DBI. My Perl programs always print to stderr: "NOTICE: UserAbortTransactionBlock and not in in-progress state" or "NOTICE: EndTransactionBlock and not inprogress/abort state" I tried to do -> finish and -> commit after each query, but the messages still appear. An

[SQL] A Question

2000-05-26 Thread Sherril Mathew
Hi, my name is sherril .I have the following Question My one feild in the database is Date/time I want to find a range of records which exists between two dates in the same date field in the database Also tell me how to retreive all records from database where field which is date time is nu

Antw: [SQL] aliases break my query

2000-05-26 Thread Gerhard Dieringer
Joseph Shraibman wrote: > These two queries are exactly alike. The first one uses aliases except > for the order by. The second uses aliases also for the order by. The > third uses whole names. The third has the behavior I want. > Someone please tell me what I am doing wrong. I don't want to h