searchelite wrote:
Hi all..how can i mirroring table in postgresql?
Let say i have a transaction table updated everyday, i want to mirror that
table so that the other table only store the latest updated day records..
I hope you can understand my question..
It sounds like what you want is to
Hello,
I'm having the same issues as dvs had in message thread
http://archives.postgresql.org/pgsql-general/2008-05/msg01117.php as I want
to be able to use the result from an INSERT INTO table(...) VALUES(...)
RETURNING new_row_ID.
I would ideally like to be able to capture the RETURNING
Just a thought
Why can't you create a temporary table from your dynamic query and use that
temp table in the for loop.
Thnx,
Gnanavel
- Original Message -
From: Sathish Duraiswamy [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Cc: Willy-Bas Loos [EMAIL PROTECTED],
Hi Sathish,
I too mentioned the same thing. I have changed my code and checked ...but
not got that worked.
Here is the code which I finally got worked !!!
CREATE OR REPLACE FUNCTION fun_orderreport(pmorderid integer, pmcompanyid
integer, pmeventid integer)
RETURNS SETOF orderreport AS
I've found my solution as in the help file under RETURNING INTO. It would
be nice if this was referenced on the INSERT documentation.
Dale
From: [EMAIL PROTECTED]
Sent: Thursday, 14 August 2008 15:32
To: pgsql-general@postgresql.org
Subject: [GENERAL] cannot use result of (insert ..
Hello
you can wrap INSERT STATEMENT into function. Than you can do anything
with result;
create table f(a timestamp);
postgres=# select * from (insert into f values(current_timestamp)
returning *) x where x.a now();
ERROR: syntax error at or near into
LINE 1: select * from (insert into f
Hello.
I create a table:
CREATE TABLE groups (
group_id serial PRIMARY KEY,
name varchar(64) UNIQUE NOT NULL,
guests integer[] DEFAULT '{}'
)
I add a new record to the table:
INSERT INTO groups (name) VALUES ('My friends');
Now the table contains 1 record:
| group_id |name|
Richard Huxton wrote, On 15-Jul-2008 15:19:
Sergey Konoplev wrote:
Yes it is. But it the way to break integrity cos rows from table2
still refer to deleted rows from table1. So it conflicts with
ideology isn't it?
Yes, but I'm not sure you could have a sensible behaviour-modifying
BEFORE
Magnus Hagander wrote:
Tom Tom wrote:
Tom Tom wrote:
Hello,
We have a very strange problem when restoring a database on Windows XP.
The PG version is 8.1.10
The backup was made with the pg_dump on the same machine.
pg_restore -F c -h localhost -p 5432 -U postgres -d configV3 -v
On Thu, Aug 14, 2008 at 2:55 AM, Craig Ringer
[EMAIL PROTECTED] wrote:
William Temperley wrote:
A. Two databases, one for transaction processing and one for
modelling. At arbitrary intervals (days/weeks/months) all good data
will be moved to the modelling database.
B. One database, where all
Hi,
i just stumbled on something very strange.
I have here a Postgres 8.3 and a Postgres 8.2 installation, as I am in
the process of merging. Both are from the debian/testing tree, both have
the same configuration file.
In my DB where I found out this trouble I have two tables, I do a very
Hello!
I have following table:
CREATE TABLE table1 (
field1 INTEGER NOT NULL,
field2 INTEGER NOT NULL,
field3 CHARACTER(30),
... some more numeric fields)
I have also those indexes:
CREATE UNIQUE INDEX idx1 ON table1 USING btree (field3, field2, field1)
CREATE
Am Thursday, 14. August 2008 schrieb Clemens Schwaighofer:
Why is Postgres not using the indexes in the 8.3 installation.
Might have something to do with the removal of some implicit casts. You
should show us your table definitions.
--
Sent via pgsql-general mailing list
Am Thursday, 14. August 2008 schrieb Dmitry Teslenko:
SELECT SUM(...) FROM table1 WHERE field3 = 'ABC' AND field1 1
GROUP BY field2
And planner picks up a sequential scan of a table. Why does he?
Presumably because it thinks it is the best plan, and I see no reason to doubt
that
Clemens Schwaighofer [EMAIL PROTECTED] writes:
Any tips why this is so?
They don't appear to contain the same data.
If they do have you run analyze recently?
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!
--
Sent via
On Thu, Aug 14, 2008 at 15:30, Peter Eisentraut [EMAIL PROTECTED] wrote:
Am Thursday, 14. August 2008 schrieb Dmitry Teslenko:
SELECT SUM(...) FROM table1 WHERE field3 = 'ABC' AND field1 1
GROUP BY field2
And planner picks up a sequential scan of a table. Why does he?
Presumably
the columns referenced in the predicate need to reference columns
whichimplement indexes to avert FTSAnyone else?Martin
__ Disclaimer and confidentiality
note Everything in this e-mail and any attachments relates to the official
business of Sender.
Tom Tom wrote:
Magnus Hagander wrote:
Tom Tom wrote:
Tom Tom wrote:
Hello,
We have a very strange problem when restoring a database on Windows XP.
The PG version is 8.1.10
The backup was made with the pg_dump on the same machine.
pg_restore -F c -h localhost -p 5432 -U postgres -d
Scott Marlowe wrote:
PLEASE DON'T WRITE TO THIS LIST WITH A FAKE EMAIL ADDRESS.
It's been discussed before, but it's rude and counterproductive. Just
set up a filter / account that drops everything coming in, but don't
stick the rest of us with your broken email behaviour
I'm sorry, just
Scott Marlowe wrote:
On Tue, Aug 12, 2008 at 9:25 AM, Daneel [EMAIL PROTECTED] wrote:
While going through
http://wiki.postgresql.org/wiki/Detailed_installation_guides
and typing
service postgresql start
as root I got
/var/lib/pgsql/data is missing. Use service postgresql initdb to
initialize
Martin Marques wrote:
Daneel escribió:
Daneel wrote:
While going through
http://wiki.postgresql.org/wiki/Detailed_installation_guides
and typing
service postgresql start
as root I got
/var/lib/pgsql/data is missing. Use service postgresql initdb to
initialize the cluster first.
When I run
On Thu, Aug 14, 2008 at 4:18 AM, Daneel [EMAIL PROTECTED] wrote:
Martin Marques wrote:
Daneel escribió:
Daneel wrote:
While going through
http://wiki.postgresql.org/wiki/Detailed_installation_guides
and typing
service postgresql start
as root I got
/var/lib/pgsql/data is missing. Use
Joost Kraaijeveld wrote:
ALTER TABLE ... ALTER COLUMN TYPE might help you. Use the USING clause
if you need a non-default data conversion -- in this case it might look
like USING (col = '1') or some such.
ALTER TABLE odbcdest ALTER COLUMN odbc_bool TYPE bool
gives:
ERROR: column
This may be a long shot... But I had a slow query once on a large table
because the query plan was doing a sequential scan, even after analyze.
I set default_statistics_target to 1000 (in postgres.conf), rebooted
and reanalyzed. A much better query plan was developed as a result and
the query
-Original Message-
From: Dmitry Teslenko [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 6:57 AM
To: pgsql-general@postgresql.org
Subject: Strange query plan
Hello!
I have following table:
CREATE TABLE table1 (
field1 INTEGER NOT NULL,
field2 INTEGER NOT
On Thu, Aug 14, 2008 at 17:55, Igor Neyman [EMAIL PROTECTED] wrote:
-Original Message-
From: Dmitry Teslenko [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 6:57 AM
To: pgsql-general@postgresql.org
Subject: Strange query plan
Hello!
I have following table:
CREATE
On 14 août 08, at 16:28, Dmitry Teslenko wrote:
On Thu, Aug 14, 2008 at 17:55, Igor Neyman [EMAIL PROTECTED]
wrote:
-Original Message-
From: Dmitry Teslenko [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 6:57 AM
To: pgsql-general@postgresql.org
Subject: Strange query plan
What does explain analyze select (your query here) have to say?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On Thu, Aug 14, 2008 at 18:47, Scott Marlowe [EMAIL PROTECTED] wrote:
What does explain analyze select (your query here) have to say?
Expalin analyze says it makes sequential scan on a table table1.
On Thu, Aug 14, 2008 at 18:48, Gauthier, Dave [EMAIL PROTECTED] wrote:
Try this...
Set
Try this...
Set default_statistics_target to be 1000 in postgres.conf then reboot
your pg server. Analyze the table. Try the query again.
If that fails, drop the index on (field1, field3) and recreate the other
way around (field3, field1). Analyze again and try the query.
-dave
On Tue, 2008-08-12 at 17:25 +0200, Daneel wrote:
When I run
service postgresql initdb
I get
se: [FAILED].
However, /var/lib/pqsql/data is created and user postgres owns it.
But then I run
service postgresql start
and the very same error occurs..
Anything in
On Thu, Aug 14, 2008 at 8:48 AM, Gauthier, Dave [EMAIL PROTECTED] wrote:
Try this...
Set default_statistics_target to be 1000 in postgres.conf then reboot
your pg server. Analyze the table. Try the query again.
A reload is enough. I think you might have to disconnect and
reconnect your
Can you define a custom sort in postgres? For instance in mysql, you
could do something like (I forget the exact syntax)
ORDER BY FIND_IN_SET(column_name, ('one','two','three'))
Art
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
Artacus a écrit :
Can you define a custom sort in postgres? For instance in mysql, you
could do something like (I forget the exact syntax)
ORDER BY FIND_IN_SET(column_name, ('one','two','three'))
I don't really know this syntax but isn't it something like :
ORDER BY column_name='one',
In response to Artacus [EMAIL PROTECTED]:
Can you define a custom sort in postgres? For instance in mysql, you
could do something like (I forget the exact syntax)
ORDER BY FIND_IN_SET(column_name, ('one','two','three'))
You could do this by defining an ENUM for the values. ENUMs sort in
Hello,
I'd like to ask you about some experience in managing huge databases which
store mostly binary files. We're developing a system which is likely to
grow up to terabytes in some years and I'd like to hear something from
people who really administrate these kinds of databases.
Please tell us
[EMAIL PROTECTED] wrote on 08/14/2008 01:21:26 AM:
Hello.
I create a table:
CREATE TABLE groups (
group_id serial PRIMARY KEY,
name varchar(64) UNIQUE NOT NULL,
guests integer[] DEFAULT '{}'
)
I add a new record to the table:
INSERT INTO groups (name) VALUES ('My friends');
On Thu, 2008-08-14 at 10:22 -0700, Artacus wrote:
Can you define a custom sort in postgres? For instance in mysql, you
could do something like (I forget the exact syntax)
ORDER BY FIND_IN_SET(column_name, ('one','two','three'))
You can sort by any column, or arbitrary expression or
On Thu, Aug 14, 2008 at 20:27, Peter Eisentraut [EMAIL PROTECTED] wrote:
Am Thursday, 14. August 2008 schrieb Clemens Schwaighofer:
Why is Postgres not using the indexes in the 8.3 installation.
Might have something to do with the removal of some implicit casts. You
should show us your
Anyone aware of an ER model for holding name server records?
Working on the zone file data and I am getting close but keep running
into the differences between MX records (with a priority) and the others
that can hold either a domain/sub-domain/host name or an IP address
depending on whether
Mr Anderson-you use an enum to indicate your DNSrecordtype as in this MySQL
exampleCREATE TABLE dns_updates| Field |Type | Null | Key |
Default | Extra || id| int(11) | NO | PRI | NULL | auto_increment ||
bd_order_id| int(11) | YES | | NULL
Hi,
I have a table
select id, config_id, start_day, end_day, start_time, end_time from config;
id | config_id | start_day | end_day | start_time | end_time
-+---+---+-++--
1 | 101 | Mon | Sun | 08:30:00 | 18:00:00
2 |
Hi Pavel,
Thank you for your reply, but in this case the “INSERT INTO ... RETURNING
field,... INTO STRICT variable,...;” is what works best for me currently.
Regards,
Dale Harris
-Original Message-
From: Pavel Stehule [mailto:[EMAIL PROTECTED]
Sent: Thursday, 14 August
Hi ,
below can work?
select config_id, start_day as day, start_time, end_time from config
union
select config_id, end_day as day, start_time, end_time from config
Best Regards,
Hui Xie
---
Axisoft Co. Ltd. Zhuhai Branch
Tel: (86) 0756-3612121 8858
Artacus wrote:
Can you define a custom sort in postgres? For instance in mysql, you
could do something like (I forget the exact syntax)
ORDER BY FIND_IN_SET(column_name, ('one','two','three'))
The simplest direct mapping would probably be a CASE statement (see the
PostgreSQL documentation).
On Thu, Aug 14, 2008 at 04:20:14PM -0700, Roderick A. Anderson wrote:
Anyone aware of an ER model for holding name server records?
What about a datatype? I have reason to believe that a company I used
to work for implemented such a thing. There was some talk of
releasing it, but I think there
2008/8/15 novice [EMAIL PROTECTED]:
Hi,
I have a table
select id, config_id, start_day, end_day, start_time, end_time from config;
id | config_id | start_day | end_day | start_time | end_time
-+---+---+-++--
1 | 101 | Mon |
If I read this correctly, you want the output sorted by
config_id,start_day(day),start_time,
thus:
select config_id, start_day as day, start_time, end_time from config
order by config_id, start_day, start_time;
Cheers,
Brent Wood
novice [EMAIL PROTECTED] 08/15/08 3:55 PM
Hi,
I have a
48 matches
Mail list logo