On Monday, June 30, 2003, at 12:00 PM, scott.marlowe wrote:
On Mon, 30 Jun 2003, Matthew Hixson wrote:
On Monday, June 30, 2003, at 05:06 AM, scott.marlowe wrote:
On Fri, 27 Jun 2003, Matthew Hixson wrote:
Hi, I have a bunch of records that I need to delete from our
database.
These records re
Hello,
I have a table like this:
create table test (
"test_id" serial primary key,
"created" timestamp with time zone
default current_timestamp
check(created = current_timestamp),
"some_datum" int not null
);
My question concerns the "created" attribute: I want this to reflect wh
On Tue, 1 Jul 2003, Matthew Hixson wrote:
>
> On Monday, June 30, 2003, at 12:00 PM, scott.marlowe wrote:
>
> > On Mon, 30 Jun 2003, Matthew Hixson wrote:
> >
> >> On Monday, June 30, 2003, at 05:06 AM, scott.marlowe wrote:
> >>
> >>> On Fri, 27 Jun 2003, Matthew Hixson wrote:
> >>>
> Hi, I
Hi,
I have problem start database.
1) I compile postgresql 7.3.3 with parameters.
./configure --enable-nls --enable-multibyte --enable-locale
2) Then set env variables ,
export LANG=cs_CZ
3) initdb -D /my_cz_db
Initdb returned :
The files belonging to this database system will be owned b
Erik Erkelens <[EMAIL PROTECTED]> writes:
> DECLARE
> new_max_records ALIAS FOR $1;
> BEGIN
> CREATE SEQUENCE my_sequence MAXVALUE new_max_records CYCLE;
> ERROR: parser: parse error at or near "$1" at character 39
You'll need to use EXECUTE to construct and execute that
On Mon, 2003-06-30 at 20:35, Josh Berkus wrote:
> Robert,
>
> > delete * from foo where not (foo.a = bar.a and foo.b=bar.b and
> > foo.c=bar.c) ;
> >
> > so i end up with
> >
> > postgres=# select * from foo;
> > a | b | c | d
> > ---+---+---+---
> > 1 | 2 | 4 | A
> > 4 | 5 | 6 | b
> > (2
On Tue, 2003-07-01 at 13:33, Tom Lane wrote:
> Erik Erkelens <[EMAIL PROTECTED]> writes:
> > DECLARE
> > new_max_records ALIAS FOR $1;
> > BEGIN
> > CREATE SEQUENCE my_sequence MAXVALUE new_max_records CYCLE;
>
> > ERROR: parser: parse error at or near "$1" at character 3
Rado Petrik <[EMAIL PROTECTED]> writes:
> export LANG=cs_CZ
> Failed to initialize lc_messages to ''
> FATAL: invalid value for option 'LC_MESSAGES': 'cs_CZ'
Evidently your platform doesn't have complete support for setting locale
to cs_CZ. Try it again with a combination like
export L
Hello,
I am building an rpm for Mitle SME (a scaled down redhat 7.3) and have all functions
working except:
I need to have the rpm when installed create a database and a user with privilege to
that database.
These are the command functions I need to execute within the rpm...
# service postgres
On Mon, Jun 30, 2003 at 18:26:38 -0400,
Robert Treat <[EMAIL PROTECTED]> wrote:
> what i want to do is:
>
> delete * from foo where not (foo.a = bar.a and foo.b=bar.b and
> foo.c=bar.c) ;
For the case without not (which appears to be what you really want)
you can pretty much do this.
See below
Hello,
On Tue, 2003-07-01 at 18:28, Robert Treat <[EMAIL PROTECTED]>
wrote:
> > want to make sure that the "crated" attribut for a tuple is
> > not changed once it has been set.
> >
> > I'm thinking about implementing it through a trigger, but is there a
> > better way to create such "immutable"
It seems that one of the other locale variables (LC_ALL?) still contains
values that are not accepted. Note that initdb reports about cs_CS, which
is not what you set.
Rado Petrik writes:
> Hi,
> I have problem start database.
>
> 1) I compile postgresql 7.3.3 with parameters.
>
> ./configure -
On Tue, 2003-07-01 at 05:59, Troels Arvin wrote:
> Hello,
>
> I have a table like this:
>
> create table test (
> "test_id" serial primary key,
> "created" timestamp with time zone
> default current_timestamp
> check(created = current_timestamp),
> "some_datum" int not null
> );
>
Josh Berkus <[EMAIL PROTECTED]> writes:
> Stefan,
>
> > I know the LEAST and GREATEST functions are not part
> > of standard SQL, but they sure were handy where I came
> > from (Oracle-land).
>
> Um, what's wrong with MAX and MIN, exactly?
MAX and MIN are single-parameter aggregate functions. L
On Tuesday, July 1, 2003, at 05:47 AM, scott.marlowe wrote:
what does the output of psql say if you have the /timing switch on?
# select cart_id from carts except (select distinct cart_id from
cart_contents) limit 1;
cart_id
-
2701
(1 row)
Time: 10864.89 ms
# explain analyze delete f
On Tue, Jul 01, 2003 at 12:29:16 -0400,
Greg Stark <[EMAIL PROTECTED]> wrote:
>
> SELECT greatest(a,b) FROM bar
>
> would return one tuple for every record in the table with a single value
> representing the greater of bar.a and bar.b.
You can do this with case.
SELECT CASE WHEN a >= b THEN a
On Tue, 1 Jul 2003, Matthew Hixson wrote:
>
> On Tuesday, July 1, 2003, at 05:47 AM, scott.marlowe wrote:
> >>>
> >>> what does the output of psql say if you have the /timing switch on?
> >>
> >> # select cart_id from carts except (select distinct cart_id from
> >> cart_contents) limit 1;
> >>
Greg Stark wrote:
SELECT greatest(a,b) FROM bar
would return one tuple for every record in the table with a single value
representing the greater of bar.a and bar.b.
You could define your own functions to do this but it would be tiresome to
define one for every datatype.
In 7.4devel (just starting
> Um, what's wrong with MAX and MIN, exactly?
MIN and MAX are aggregate functions, LEAST and
GREATEST are not. See the examples on the following
table:
foo
A B
- -
1 4
2 3
3 2
> SELECT LEAST(a, b), GREATEST(a, b) FROM foo;
LEAST(a, b) GREATEST(a, b)
--- --
1 4
2
hi there,
I have a problem trying to execute a complex query that was designed in
7.3.2 to a machine running 7.2.x
this is the error message
FULL JOIN is only supported with mergejoinable join conditions
this is the source string for a jdbc prepared statement. (it has ordering
clause added at t
Is it possible?
From what I tried it is possible to create such a function
but it is not possible to call it ?!
Can anyone provide an example?
Tnx.
"kevin rowe" <[EMAIL PROTECTED]> writes:
> I have a problem trying to execute a complex query that was designed in
> 7.3.2 to a machine running 7.2.x
> this is the error message
> FULL JOIN is only supported with mergejoinable join conditions
Nested FULL JOINs don't work in 7.2.*. The fix is not
Joe Conway wrote:
In 7.4devel (just starting beta) you can do this:
Actually to correct myself, we just started "feature freeze" for 7.4,
with beta planned to start on or about July 15th.
Sorry for any confusion caused.
Joe
---(end of broadcast)--
Joe,
> create or replace function greatest(anyelement, anyelement) returns
> anyelement as 'select case when $1 > $2 then $1 else $2 end' language
> 'sql';
Way cool. I'd have to imagine that it would blow up if you did this, though:
select greatest ( 512, now() );
With an "Operator is not defi
Josh Berkus wrote:
create or replace function greatest(anyelement, anyelement) returns
anyelement as 'select case when $1 > $2 then $1 else $2 end' language
'sql';
Way cool. I'd have to imagine that it would blow up if you did this, though:
select greatest ( 512, now() );
With an "Operator is no
Alon Noy wrote:
From what I tried it is possible to create such a function but it is not
possible to call it ?!
Can anyone provide an example?
create table foo (f1 int, f2 text);
insert into foo values(1,'a');
insert into foo values(2,'b');
insert into foo values(3,'c');
create or replace function
good day!
i would like to ask for the sql statement to the output:
ITEM DESC Jan Feb Mar Apr ... Sep Total
xx 999 999 999 999 ... 999 9,999
where "Jan" column is sum of all "x" items purchased on Jan, "Feb" column as
sum of Feb purchases, and so on up to "Sep", and "Tot
Dear All,
I begin a transaction. I then execute a SQL
command "SELECT FOR UPDATE" to lock some records on the first session. Besides,
I also lock some rows using the same method on the second session. Is it
possible to return an error message to indicate that some records were locked by
an
Greg Stark wrote:
MAX and MIN are single-parameter aggregate functions. LEAST and GREATEST are
two-parameter (though in postgres they could be defined for 3 and more
parameters) scalar functions.
If LEAST and GREATEST can accept any number of parameters, wouldn't it
make sense to code it like the
Hi,
I know that if you have a trigger and function then drop/replace the
function the trigger needs
to be drop/replaced too so that it can see the new function.
Is it the same for Ref. Integ. on table's too ?
If table B's foreign key references table A and you drop/replace table A
then the refe
On Wed, 2 Jul 2003, Rudi Starcevic wrote:
> Hi,
>
> I know that if you have a trigger and function then drop/replace the
> function the trigger needs
> to be drop/replaced too so that it can see the new function.
>
> Is it the same for Ref. Integ. on table's too ?
>
> If table B's foreign key refe
Ang Chin Han <[EMAIL PROTECTED]> writes:
> If LEAST and GREATEST can accept any number of parameters, wouldn't it
> make sense to code it like the way COALESCE works, rather than defining
> a function for it? This way we don't need define all the various
> functions with different types.
But CO
Hello,
Any one who knows, how to start the postgresql service on sun solaris
server. Please help me in this regards.
Thank you.
Regards,
Atul Pedgaonkar
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Tom Lane wrote:
But COALESCE is a special feature hard-wired into the parser. There's
no free lunch --- you pay for your extensibility somewhere.
That's what I'm suggesting: hard-wiring LEAST and GREATEST into the
parser. 7.5, maybe?
The question is: is it worth hard-wiring vs functions? (time
Dear All,
May I execute a SQL to find out user's
information (e.g. user id or ip address) who are connecting to a
database?
THX!!
JMAN
Ang Chin Han <[EMAIL PROTECTED]> writes:
> I'd say we need to have LEAST and GREATEST at least somewhere in contrib
> (as functions) if not core, to make transition from other RDBMS to
> postgresql easier.
> A brief test shows that we would incur quite a performance penalty (I
> compared COALESC
36 matches
Mail list logo