At 11:20 PM 11/24/2008, [EMAIL PROTECTED] wrote:
Message-Id: <[EMAIL PROTECTED]>
From: ries van Twisk <[EMAIL PROTECTED]>
To: Tk421 <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
Subject: Re: Sequence and nextval problem
Date: Mon, 24 Nov 2008 16:21:40 -0500
References: <[EMAIL PROTECTED]>
Earlier, Craig Ringer wrote:
for sample operator/cast definitions. There are some notes in the top of
the "passthrough.txt" module I attached that explain the ODBC driver
options you'll want.
Also, note that in the message I just posted the function DSN() must be
adapted to include the appro
Tk421 wrote:
Hello everybody.
I've got an vb aplication that uses an Access database. I'm trying to
convert the database to postgres. The conversion was done ok, but i've
got a little problem that i don't know how to solve. Let's see if anyone
can help me.
The conversion from acces
On Nov 24, 2008, at 2:12 PM, Tk421 wrote:
Hello everybody.
I've got an vb aplication that uses an Access database. I'm trying
to convert the database to postgres. The conversion was done ok, but
i've got a little problem that i don't know how to solve. Let's see
if anyone can help me
On Mon, Nov 24, 2008 at 12:12 PM, Tk421 <[EMAIL PROTECTED]> wrote:
> Hello everybody.
>
> I've got an vb aplication that uses an Access database. I'm trying to
> convert the database to postgres. The conversion was done ok, but i've got a
> little problem that i don't know how to solve. Let's s
Hello everybody.
I've got an vb aplication that uses an Access database. I'm trying
to convert the database to postgres. The conversion was done ok, but
i've got a little problem that i don't know how to solve. Let's see if
anyone can help me.
The conversion from access database to
> Is there a function or special system label I can use that would
generate a sequence number in the returning result set?
Would something like this work for you?
CREATE TEMP SEQUENCE foo;
SELECT a, b, c, nextval('foo') AS order FROM t1 ORDER BY a;
Mike Relyea
Product Development Engineer
Xe
"Campbell, Lance" <[EMAIL PROTECTED]> writes:
> Is there a function or special system label I can use that would
> generate a sequence number in the returning result set?
The usual hack is a temporary sequence:
regression=# create temp sequence s1;
CREATE SEQUENCE
regression=# select nextval('s1'
: Thursday, October 09, 2008 5:48 PM
Subject: Re: [SQL] sequence number in a result
Howdy, Lance.
I had that problem about a year ago, and AFAIK there is no solution, at least
not in SQL Standard.
What I did was something like
SELECT a,b,c,count(y.a) as order
FROM t1 x , t1 y
WH
t;iPages\" ) " +
"OR (resumo1.\"iPages\" = resumo2.\"iPages\" " +
"AND resumo1.\"IDSiteResume\" <= resumo2.\"IDSiteResume\")) " + // Tinha e tem
IDSiteResume
"GROUP BY resumo1.\"iPages\",resumo1.\"iUniq
Say I have the following SQL statement:
SELECT a, b, c FROM t1 ORDER BY a;
Is there a function or special system label I can use that would
generate a sequence number in the returning result set?
Example:
SELECT a, b, c, SOMELABEL as order FROM t1 ORDER BY a;
Result:
ab c
On 5/7/07, Tom Lane <[EMAIL PROTECTED]> wrote:
Andrew Sullivan <[EMAIL PROTECTED]> writes:
> On Sun, May 06, 2007 at 01:45:54PM -0500, Aaron Bono wrote:
>> So my conclusion is that the function is being treated as volatile even
>> though it is stable because the number of records is small.
> I
Andrew Sullivan <[EMAIL PROTECTED]> writes:
> On Sun, May 06, 2007 at 01:45:54PM -0500, Aaron Bono wrote:
>> So my conclusion is that the function is being treated as volatile even
>> though it is stable because the number of records is small.
> I don't think that's the issue. If this is depende
On Sun, May 06, 2007 at 01:45:54PM -0500, Aaron Bono wrote:
> Then I inserted 150 more records in the slow schema and pow - it started
> working like the fast schema.
>
> So my conclusion is that the function is being treated as volatile even
> though it is stable because the number of records i
On 5/5/07, Jaime Casanova <[EMAIL PROTECTED]> wrote:
On 5/5/07, Aaron Bono <[EMAIL PROTECTED]> wrote:
> On 5/5/07, Tom Lane <[EMAIL PROTECTED]> wrote:
> > "Aaron Bono" <[EMAIL PROTECTED]> writes:
> > > 9. -> Seq Scan on branch (cost=
0.00..4.72
> rows=1
> > > width=12
On 5/5/07, Aaron Bono <[EMAIL PROTECTED]> wrote:
On 5/5/07, Tom Lane <[EMAIL PROTECTED]> wrote:
> "Aaron Bono" <[EMAIL PROTECTED]> writes:
> > 9. -> Seq Scan on branch (cost=0.00..4.72
rows=1
> > width=1281) (actual time= 130129.988..157492.057 rows=1 loops=1)
> > 10.
On 5/5/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Aaron Bono" <[EMAIL PROTECTED]> writes:
> 9. -> Seq Scan on branch (cost=0.00..4.72rows=1
> width=1281) (actual time=130129.988..157492.057 rows=1 loops=1)
> 10.Filter: ((start_day <= now(
On 5/5/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote:
On Sat, May 05, 2007 at 05:00:53PM -0500, Aaron Bono wrote:
> We don't allow deletes and updates are fairly infrequent. I also did a
> vacuum analyze to no effect.
How do you "not allow" deletes?
Permissions are set on the tables to onl
On 5/5/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Aaron Bono" <[EMAIL PROTECTED]> writes:
> 9. -> Seq Scan on branch (cost=0.00..4.72rows=1
> width=1281) (actual time=130129.988..157492.057 rows=1 loops=1)
> 10.Filter: ((start_day <= now(
On Sat, May 05, 2007 at 05:00:53PM -0500, Aaron Bono wrote:
>
> They have different data. The fast one has about 150 rows and the slow one
> has about 40 rows. The field in question here, the branch_id, is a
> BIGSERIAL in both.
I'd be astonished if a table of 40 rows ever got index scanned.
"Aaron Bono" <[EMAIL PROTECTED]> writes:
> 9. -> Seq Scan on branch (cost=0.00..4.72 rows=1
> width=1281) (actual time=130129.988..157492.057 rows=1 loops=1)
> 10.Filter: ((start_day <= now()) AND
> ((end_day IS NULL) OR (end_day >= now())
On 5/5/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote:
On Sat, May 05, 2007 at 04:05:52PM -0500, Aaron Bono wrote:
> I have two schemas, both with the exact same DDL. One performs great
and
Do they have the same data?
They have different data. The fast one has about 150 rows and the slow o
On Sat, May 05, 2007 at 04:05:52PM -0500, Aaron Bono wrote:
> I have two schemas, both with the exact same DDL. One performs great and
Do they have the same data?
> I have
> checked and there IS an index, specifically a primary key index, on the
> branch_id in both schemas so I cannot figure ou
I have two schemas, both with the exact same DDL. One performs great and
the other has problems with a specific query:
SELECT *
FROM
branch_active_vw
WHERE branch_id = get_branch_for_zip ( '22151' )
ORDER BY branch_name
;
I am not defining the view here because the explain plans show the rea
Scott Marlowe <[EMAIL PROTECTED]> writes:
> Daniel CAUNE <[EMAIL PROTECTED]> Said:
>> I was wondering when it is better to choose sequence, and when
>> it is better to use serial.
> One reason for using serial versus sequence is that a serial gives you
> automatic dependency tracking.
Note that
Daniel CAUNE <[EMAIL PROTECTED]> Said:
> I was wondering when it is better to choose sequence, and when
> it is better to use serial. The serial type is a sequence with
> default parameters
(http://www.postgresql.org/docs/8.2/static/datatype-numeric.html#DATATYPE-SERIAL).
> Actually, I never
Hi,
I was wondering when it is better to choose sequence, and when it is better
to use serial. The serial type is a sequence with default parameters
(http://www.postgresql.org/docs/8.2/static/datatype-numeric.html#DATATYPE-SE
RIAL). Actually, I never use serial - I prefer sequence for some re
"Omkar Rath" <[EMAIL PROTECTED]> writes:
> Say there is a stored procedure i.e FUNCTION sp_foo(...) which has say,
> SQL commands (any of SELECT,INSERT,UPDATE,DELETE) in its body, say S1
> followed by S2 then S3 Furthermore, execution of statement S2
> results in trigger functions getting invok
Title: Message
I am observing the
following:
Say there is a
stored procedure i.e FUNCTION sp_foo(...) which has say, SQL commands (any
of SELECT,INSERT,UPDATE,DELETE) in its body, say S1 followed by S2 then S3
Furthermore, execution of statement S2 results in trigger functions getting
"cristi" <[EMAIL PROTECTED]> writes:
> What is wrong here?
> insert into table_name (field_name) values (select
> setval('sequence_name')-1) as currval);
Either too few parentheses, or too many ;-)
You could write this as an INSERT/SELECT:
insert into table_name (field_name)
select setval('seq
On Fri, Aug 15, 2003 at 12:32:36PM +0300, cristi wrote:
> What is wrong here?
>
> insert into table_name (field_name) values (select
> setval('sequence_name')-1) as currval);
This should be better:
INSERT INTO table_name (field_name) VALUES (nextval('sequence_name'));
--
%!PS
2
On Fri, 15 Aug 2003, cristi wrote:
> What is wrong here?
>
> insert into table_name (field_name) values (select
> setval('sequence_name')-1) as currval);
Your probably want this instead:
insert into table_name (field_name) values (nextval('sequence_name'));
The reason why your insert fail ab
What is wrong here?
insert into table_name (field_name) values (select
setval('sequence_name')-1) as currval);
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
> >A trigger (maybe a rule) is the way to go about this.
> >
> >The alternative is to teach the bad clients to use DEFAULT rather than
> >NULL when they expect the GENERATOR to create the value for them.
> >
> Hmm, Rod, there really seems a demand for the GENERATOR feature :-)
> Do you see any perf
On Wed, 2003-07-02 at 11:30, Ralf Werny wrote:
> Hi,
> many clients like webmin and openoffice makes an
> INSERT NULL if i give no value for a field because it is a sequence.
> Is there a better way to solve this problem as using a trigger ?
A trigger (maybe a rule) is the way to go about th
Hi,
many clients like webmin and openoffice makes an
INSERT NULL if i give no value for a field because it is a sequence.
Is there a better way to solve this problem as using a trigger ?
CREATE TABLE test (
id integer PRIMARY KEY
);
CREATE SEQUENCE test_seq_id MINVALUE
t too worried about figuring
it out...
HTH
Rod
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Marie G. Tuite
> Sent: Monday, January 27, 2003 3:06 PM
> To: Pgsql-Sql@Postgresql. Org
> Subject: [SQL] sequence question
>
>
>
Hey there,
Does anybody have a nice way to identify what table.column is using a
particular sequence on a database-wide basis?
--Thanks.
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Hi Tom,
Here is the output from 'select version()'
PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
Cheers
Rudi.
Tom Lane wrote:
>Rudi Starcevic <[EMAIL PROTECTED]> writes:
>
>
>>Just a quick one on the length of the name of a sequence.
>>...
>>However the sequence created is nam
> > However the sequence created is named :
> > eselect_maincategory_maincat_id ( the '_seq' is lopped off )
>
> What version are you running? Anything recent will keep the '_seq'
> and lop elsewhere.
Not if he's manually creating a sequence name that's too long - it will just
truncate it me
Rudi Starcevic <[EMAIL PROTECTED]> writes:
> Just a quick one on the length of the name of a sequence.
> ...
> However the sequence created is named :
> eselect_maincategory_maincat_id ( the '_seq' is lopped off )
What version are you running? Anything recent will keep the '_seq'
and lo
:
create table blah (
maincat_id SERIAL
);
Chris
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rudi Starcevic
> Sent: Wednesday, 17 July 2002 10:39 AM
> To: [EMAIL PROTECTED]
> Subject: [SQL] Sequence name length
>
>
&g
Hi,
Just a quick one on the length of the name of a sequence.
I have some table with long(ish) names like : eselect_maincategory
The primary key is named : maincat_id
When I create the table the sequence sql looks like
nextval('"eselect_maincategory_maincat_id_seq"'::text)
Howeve
dear subha,
Use explicit ORDER BY if u want to order the records
by some column.
otherwise the order of output from a select stmt is undefined.
bu generally it is found the the last updated record comes last.
On Wednesday 26 June 2002 17:17, Subhashini Karthikeyan wrote:
> hi all
>
>
> In post
On Wed, 26 Jun 2002, Subhashini Karthikeyan wrote:
> In postgresql 7.1.3
>
> i am updateing a row. it is a 4th record.
> after updation if i am firing a select query it is
> coming as a last record ..what shall i do to avoid
> that..
> any help appriciated
If I understand the complaint, use an
hi all
In postgresql 7.1.3
i am updateing a row. it is a 4th record.
after updation if i am firing a select query it is
coming as a last record ..what shall i do to avoid
that..
any help appriciated
thankz in advance
regards
subha
__
Do You Ya
> > binary_data=# create sequence test;
> > CREATE
> > binary_data=# select nextval('test');
> > NOTICE: test.nextval: sequence was re-created
>
> Um, how did you get that NOTICE? I don't see it.
This is version 7.0.3. I deleted the sequence first.
> Anyway, the answer to your question is tha
Grant <[EMAIL PROTECTED]> writes:
> Why is the following like it is? I would think that nextval would return 2
> in both instances, am I missing something here? :) Thanks!
> binary_data=# create sequence test;
> CREATE
> binary_data=# select nextval('test');
> NOTICE: test.nextval: sequence was
Why is the following like it is? I would think that nextval would return 2
in both instances, am I missing something here? :) Thanks!
binary_data=# create sequence test;
CREATE
binary_data=# select nextval('test');
NOTICE: test.nextval: sequence was re-created
nextval
-
1
(1 row)
On Mon, 21 May 2001, gabi munteanu wrote:
> I have the following problem.
>
> I have a table [friends] and it looks like this:
>id serial
>name varchar(25)
>phone varchar(15)
> After I created it tehre is also a sequence that generates me the ids
> friens_id_s
I have the following problem.
I have a table [friends] and it looks like this:
id serial
name varchar(25)
phone varchar(15)
After I created it tehre is also a sequence that generates me the ids
friens_id_seq
Let's say I have 5 records.
If I remove the 3th my ids
51 matches
Mail list logo