In response to Sim Zacks :
> >
> > I'm trying to write an INSERT INTO statement that will use a DEFAULT
> > value when an input parameter is null.
> >
> Neither of my 2 methods are pretty.
> 1) Use a trigger.
> 2) Grab and cast the default value from the information_schema.columns
> view and plu
>> I'm trying to write an INSERT INTO statement that will use a DEFAULT
>> value when an input parameter is null.
>>
> Neither of my 2 methods are pretty.
> 1) Use a trigger.
> 2) Grab and cast the default value from the information_schema.columns
> view and plug it in.
>
> Another option is to bui
>
> I'm trying to write an INSERT INTO statement that will use a DEFAULT
> value when an input parameter is null.
>
Neither of my 2 methods are pretty.
1) Use a trigger.
2) Grab and cast the default value from the information_schema.columns
view and plug it in.
Another option is to build your i
Hi,
I'm trying to write an INSERT INTO statement that will use a DEFAULT
value when an input parameter is null.
Here's the function that fails to compile. I tried replacing Coalesce
with a Case statement but that fails as well. Note that if you
replace the condition with a simple 'Default' it c
Rob,
There are many users of hstore, so you can get support here. Also, someone
is working on the new improved version of hstore, check pgfoundry and
-hackers mailing list.
Oleg
On Mon, 28 Sep 2009, InterRob wrote:
Second glance: brilliant again! Even support for indexing is available; nice
j
"Brendan Hill" writes:
> Bit of a catch 22 - since it happens rarely, there's no definitive
> confirmation that it's fixed the problem.
> Also, not sure if I'm comfortable applying the change and recompiling
> myself, wouldn't have a clue where to start.
Uh, so you haven't actually tested it at a
Hi Tom,
Bit of a catch 22 - since it happens rarely, there's no definitive
confirmation that it's fixed the problem.
Also, not sure if I'm comfortable applying the change and recompiling
myself, wouldn't have a clue where to start.
I can't see how the change would hurt though, seems like a good
INSERTS/UPDATES are historically slow especially with autocommit is on (implied
autocommit on)
the Database writer actually stops any processing and applies that one record
to the database
Most bulk operations such as import/export and copy are well worth their weight
as they apply en-masse
bef
On Mon, Sep 28, 2009 at 04:35:53PM -0500, Dave Huber wrote:
> One assumption I am operating under right now is
> that the format of the binary file is the same as the buffer in
> PQputCopyData, including the header. If I am wrong, could someone
> please let me know? Thanks,
I've always used ASCII
Thanks, Sam and Martijn. I am attempting to use the COPY command now. I had
misunderstood what was meant by STDIN and assumed I could only use a file for
my application and wasn't aware of PQputCopyData(). One assumption I am
operating under right now is that the format of the binary file is the
The schedule for pgday.eu 2009 is now available at
http://2009.pgday.eu/schedule
Registration for the conference is also open at
http://2009.pgday.eu/register
including full payment details. We appreciate it if you can register as soon
as possible, to make it easier for us to plan the logistics.
On Mon, Sep 28, 2009 at 10:38:05AM -0500, Dave Huber wrote:
> Using COPY is out of the question as the file is not formatted for
> that and since other operations need to occur, the file needs to be
> read sequentially anyway.
Just to expand on what Martin said; if you can generate a set of EXECUT
On Mon, Sep 28, 2009 at 5:53 AM, Sam Mason wrote:
> On Sun, Sep 27, 2009 at 07:22:47PM -0600, Scott Marlowe wrote:
>> >> dd if=/dev/zero of=test.txt bs=8192 count=1310720 conv=fdatasync
>> >> 10737418240 bytes (11 GB) copied, 169.482 s, 63.4 MB/s
>> >>
>> >> dd if=test.txt of=/dev/null bs=8192
>>
On Mon, 2009-09-28 at 11:05 -0400, Reid Thompson wrote:
> We have a set of tables that we're partitioning by year and month -
>
We can't seem to quite get it right...
This is our quick stub test.
--
-- Tables:
--
CREATE TABLE payments (
id serial,
payment_name varcha
Second glance: brilliant again! Even support for indexing is available; nice
job.
I found the hstore.sql -- that will add type, functions and stuff to my db.
I will give it a serious try!
Rob
2009/9/28 InterRob
> At first glance: brilliant! I was about to implement this key/value thing
> with
On Sep 28, 2009, at 3:31 PM, Mike Christensen wrote:
One thing I like about Microsoft SQL is you can write a sproc that
does:
SELECT * FROM TableA
SELECT * FROM TableB
And in .NET, you'll have a DataSet object with two DataTables, one for
each table. Do either of the techniques outlined be
At first glance: brilliant! I was about to implement this key/value thing
with an XML type... I will take a closer look at this, thanks a lot, Oleg!
Tips & tricks to get this going in PostgreSQL?
Rob
2009/9/28 Oleg Bartunov
> Have you considered contrib/hstore to build flexible database scheme
2009/9/28 Mike Christensen :
> One thing I like about Microsoft SQL is you can write a sproc that does:
>
> SELECT * FROM TableA
> SELECT * FROM TableB
>
> And in .NET, you'll have a DataSet object with two DataTables, one for
> each table. Do either of the techniques outlined below provided this
One thing I like about Microsoft SQL is you can write a sproc that does:
SELECT * FROM TableA
SELECT * FROM TableB
And in .NET, you'll have a DataSet object with two DataTables, one for
each table. Do either of the techniques outlined below provided this
functionality, though I suppose in .NET y
Reid-
shoehorn a variable into EXECUTE statement which will be casted as text and
then do a substring to acquire extracted results
EXECUTE ''INSERT INTO payments_'' ||select * from
substring(CAST(import_ts::date AS text) from 0
for 7) || VALUES(NEW.*) || '';
other solutions?
Martin Gainty
Have you considered contrib/hstore to build flexible database scheme ?
Oleg
On Sun, 27 Sep 2009, InterRob wrote:
Dear David, dear Peter, dear all,
Peter, I was happy reading your reply right after I opened and read Davids.
I do think I am on the right track; it is not a matter of building the
o
On Mon, 2009-09-28 at 10:22 -0400, Tom Lane wrote:
> Vasiliy G Tolstov writes:
> >> some time (meybe every four day) postgresql get error to all clients
> >> what try to connect , a can attach strace to it:
>
> >> 1. What error?
>
> > postg...@calipso ~ $ psql
> > psql: FATAL: semctl(1048608, 15
On Mon, Sep 28, 2009 at 2:05 PM, Merlin Moncure wrote:
> On Mon, Sep 28, 2009 at 12:49 PM, Thom Brown wrote:
>> Hi,
>>
>> Is it possible to create a function using 'SQL' as language which could
>> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
>> TABLE2;" where both results
On Mon, Sep 28, 2009 at 12:49 PM, Thom Brown wrote:
> Hi,
>
> Is it possible to create a function using 'SQL' as language which could
> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
> TABLE2;" where both results are returned in the output? I know this can be
> done in stor
On Mon, Sep 28, 2009 at 1:29 PM, Reid Thompson wrote:
> On Mon, 2009-09-28 at 12:42 -0400, Merlin Moncure wrote:
>
>> the best way to do this is very version dependent. the basic trick is
>> to use text cast to pass a composite type into the query sting.
>>
>> one way:
>> execute 'insert into foo
On Mon, 2009-09-28 at 12:42 -0400, Merlin Moncure wrote:
> the best way to do this is very version dependent. the basic trick is
> to use text cast to pass a composite type into the query sting.
>
> one way:
> execute 'insert into foo_something select (' || new::text || '::foo).*';
>
> you can
Hello
2009/9/28 Thom Brown :
> Hi,
>
> Is it possible to create a function using 'SQL' as language which could
> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
> TABLE2;" where both results are returned in the output? I know this can be
> done in stored procedures in other
John wrote:
Hi,
I have a development DB and a production DB. I need a way to sync the changes
I make to the stucture in the devel DB to the production DB. I found pgdiff
but can't get it to work. I would like a solution that would work on windows
and linux. But I'll take either alone.
On Monday 28 September 2009 09:56:33 am Filip Rembiałkowski wrote:
> 2009/9/28 John
>
> > After all this time I'm surprized that someone hasn't
> > provide an easy way to get this done. It's has to be every developers
> > problem.
>
> hmm, maybe because there's no easy way? db schemas can be co
On Monday 28 September 2009 09:31:30 am Adrian Klaver wrote:
> - "John" wrote:
> > On Monday 28 September 2009 09:06:25 am Filip Rembiałkowski wrote:
> > > 2009/9/28 John
> > >
> > > > Hi,
> > > > I have a development DB and a production DB. I need a way to sync
> >
> > the
> >
> > > > chang
John wrote on 28.09.2009 18:24:
Thanks that will help. After all this time I'm surprized that someone hasn't
provide an easy way to get this done. It's has to be every developers
problem.
Have a look at my SQL Workbench. It has a built-in command to generate a diff
between two databases. T
2009/9/28 John
> After all this time I'm surprized that someone hasn't
> provide an easy way to get this done. It's has to be every developers
> problem.
>
>
hmm, maybe because there's no easy way? db schemas can be complicated...
there are some commercial tools for db comparing but they are n
On Sep 28, 2009, at 9:24 AM, John wrote:
On Monday 28 September 2009 09:06:25 am Filip Rembiałkowski wrote:
2009/9/28 John
Hi,
I have a development DB and a production DB. I need a way to sync
the
changes
I make to the stucture in the devel DB to the production DB. I
found
pgdiff
bu
Hi,
Is it possible to create a function using 'SQL' as language which could
return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
TABLE2;" where both results are returned in the output? I know this can be
done in stored procedures in other RBDMS but can this be done in a function?
On Mon, Sep 28, 2009 at 11:05 AM, Reid Thompson wrote:
> We have a set of tables that we're partitioning by year and month -
> e.g. payments_parent, partitioned into payments_200901, payments200902, ...
> and inquiries_parent, partitioned into inquiries_200901, inquiries_200902,
> ...
>
> Each t
On Mon, 28 Sep 2009, Maximilian Tyrtania wrote:
> testdb=# create table byteatest(blob bytea);
> CREATE TABLE
> testdb=# insert into byteatest (blob) values (E'\\007');
> INSERT 0 1
> testdb=# insert into byteatest (blob) values (E'\\008');
> ERROR: invalid input syntax for type bytea
> LINE 1: i
- "John" wrote:
> On Monday 28 September 2009 09:06:25 am Filip Rembiałkowski wrote:
> > 2009/9/28 John
> >
> > > Hi,
> > > I have a development DB and a production DB. I need a way to sync
> the
> > > changes
> > > I make to the stucture in the devel DB to the production DB. I
> found
>
On Monday 28 September 2009 09:06:25 am Filip Rembiałkowski wrote:
> 2009/9/28 John
>
> > Hi,
> > I have a development DB and a production DB. I need a way to sync the
> > changes
> > I make to the stucture in the devel DB to the production DB. I found
> > pgdiff
> > but can't get it to work. I
PG 8.4.0 running on Mac OS 10.6.1
Could anyone tell me why the bytea datatypes seems to like some bytes better
than others?
testdb=# create table byteatest(blob bytea);
CREATE TABLE
testdb=# insert into byteatest (blob) values (E'\\007');
INSERT 0 1
testdb=# insert into byteatest (blob) values (E
2009/9/28 John
> Hi,
> I have a development DB and a production DB. I need a way to sync the
> changes
> I make to the stucture in the devel DB to the production DB. I found
> pgdiff
> but can't get it to work. I would like a solution that would work on
> windows
> and linux. But I'll take e
We have a set of tables that we're partitioning by year and month -
e.g. payments_parent, partitioned into payments_200901, payments200902, ...
and inquiries_parent, partitioned into inquiries_200901, inquiries_200902, ...
Each table has a timestamp field import_ts that can be used to partition
On Mon, Sep 28, 2009 at 10:38:05AM -0500, Dave Huber wrote:
> Hi, I'm fairly new to postgres and am having trouble finding what I'm
> looking for. Is there a feature that allows bulk inserts into tables?
> My setup is Win XPe 2002 SP3 and PostgreSQL 8.3. I need to add
> entries from a file where ea
Hi,
I have a development DB and a production DB. I need a way to sync the changes
I make to the stucture in the devel DB to the production DB. I found pgdiff
but can't get it to work. I would like a solution that would work on windows
and linux. But I'll take either alone.
postgres 8.3
o
Hi, I'm fairly new to postgres and am having trouble finding what I'm looking
for. Is there a feature that allows bulk inserts into tables? My setup is Win
XPe 2002 SP3 and PostgreSQL 8.3. I need to add entries from a file where each
file contains 250 - 500 records. The files are created by a th
On Mon, Sep 28, 2009 at 6:26 PM, Tom Lane wrote:
> Sergey Konoplev writes:
>> The table filled with about 7.5E+6 rows. Most of them have different
>> from default values in obj_tsvector column. I use "estimated rows
>> count trick" to make search results counter faster, and every time
>> when obj
On Fri, Sep 25, 2009 at 9:39 AM, John R Pierce wrote:
> ADO is significantly faster than ODBC, so the preferred stack would be
> delphi -> ado -> postgres ole db -> libpq ->postgres
Is the oledb driver stable? Its never development status has never
changed from Beta over the last few years.
ht
Sergey Konoplev writes:
> The table filled with about 7.5E+6 rows. Most of them have different
> from default values in obj_tsvector column. I use "estimated rows
> count trick" to make search results counter faster, and every time
> when obj_tsvector is used estimation rows count is extremely dif
Vasiliy G Tolstov writes:
>> some time (meybe every four day) postgresql get error to all clients
>> what try to connect , a can attach strace to it:
>> 1. What error?
> postg...@calipso ~ $ psql
> psql: FATAL: semctl(1048608, 15, SETVAL, 0) failed: Invalid argument
My bet is that something has
Thank you very much, I think I need to stady more about trigger.
2009/9/28 A. Kretschmer
> In response to ? :
> > Yes, you are right. That maybe a bad example. what I want to say maybe
> like
> > this:
> >
> > create table a (
> > id integer,
> > room varchar(32),
> >
-- Forwarded message --
From: Mirko Pace
Date: Mon, Sep 28, 2009 at 2:59 PM
Subject: Re: [GENERAL] UPDATE statement with syntax error doesn't raise a
warning?
To: David W Noon
> I presume you meant "nothing" rather than "anything".
>
sorry for my poor english :/
> SET bool
In response to ? :
> Yes, you are right. That maybe a bad example. what I want to say maybe like
> this:
>
> create table a (
> id integer,
> room varchar(32),
> start time,
> end time,
> PRIMARY KEY(id)
> )
> How can I check if it is the same r
On Mon, Sep 28, 2009 at 11:55:51AM +0700, Ricky Tompu Breaky wrote:
> After I found the solution of my problem and again read the postgres
> manual, I've understood you're correct that I tried "too much" as an
> initial step for a newbie like me.
Sorry it wasn't as easy as it could be and I hope y
On Sun, Sep 27, 2009 at 07:22:47PM -0600, Scott Marlowe wrote:
> >> dd if=/dev/zero of=test.txt bs=8192 count=1310720 conv=fdatasync
> >> 10737418240 bytes (11 GB) copied, 169.482 s, 63.4 MB/s
> >>
> >> dd if=test.txt of=/dev/null bs=8192
> >> 10737418240 bytes (11 GB) copied, 86.4457 s, 124 MB/s
>
On Mon, Sep 28, 2009 at 02:33:36PM +0400, Vasiliy G Tolstov wrote:
> Hello!
>
> I'm using postgresql (8.0.15) on Gentoo Linux (2.6.27.29-titan #2 SMP
> Sun Aug 16 15:12:53 MSD 2009 x86_64 Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
> GenuineIntel GNU/Linux)
>
> some time (meybe every four day) postgresq
В Пнд, 28/09/2009 в 13:11 +0200, Martijn van Oosterhout пишет:
> On Mon, Sep 28, 2009 at 02:33:36PM +0400, Vasiliy G Tolstov wrote:
> > Hello!
> >
> > I'm using postgresql (8.0.15) on Gentoo Linux (2.6.27.29-titan #2 SMP
> > Sun Aug 16 15:12:53 MSD 2009 x86_64 Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Hello!
I'm using postgresql (8.0.15) on Gentoo Linux (2.6.27.29-titan #2 SMP
Sun Aug 16 15:12:53 MSD 2009 x86_64 Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
GenuineIntel GNU/Linux)
some time (meybe every four day) postgresql get error to all clients
what try to connect , a can attach strace to it:
post
In response to ? :
> create table a(
> name varchar(32);
> );
>
> create talbe b(
> name1 varchar(32);
> name2 varchar(32);
> );
>
>
> How to write a constraint to check name1, name2 in the table a without change
> table defination?
-- Okay, your tables with
create table a(
name varchar(32);
);
create talbe b(
name1 varchar(32);
name2 varchar(32);
);
How to write a constraint to check name1, name2 in the table a without
change table defination?
ALTER TABLE b ADD CHECK( ??? );
Hi Rob,
InterRob wrote:
If you think so, then I we do in fact agree on that... Still, however,
implementing this transparently (that is: back-end/server side; using
VIEWs, is the only way I can think of) is a major challenge.
Implementing the use of USER DEFINED additional fields within a cer
I don't know about Postgres 8.3, but with 8.4-docs the Syntax of your
query could be
select * from tblretrain where NOT ('ms-ap-t2-02c9' = ANY (owners));
regards
Ludwig
Grant Maxwell schrieb:
Hi Folks
According to the 8.3 docs I should be able to write:
select * from tblretrain where 'ms-
BTW, dead tupples <5%
On Mon, Sep 28, 2009 at 11:09 AM, Sergey Konoplev wrote:
> Hi, community
>
> I have a table containing column for FTS and an appropriate index:
>
> zzz=# \d search_table
> ...
> obj_tsvector | tsvector |
> not null default ''::tsv
Hi, community
I have a table containing column for FTS and an appropriate index:
zzz=# \d search_table
...
obj_tsvector | tsvector |
not null default ''::tsvector
...
"i_search_table__tsvector_1" gist (obj_tsvector) WHERE obj_status_did = 1
The t
62 matches
Mail list logo