AFAIK, not easily. There was a post to the hackers list recently with
code for a "database connector" function. Using this it may be possible
to write your own referential integrity triggers that reference the other
database.. maybe not. I didn't look much into the code. There might be
someth
Jaruwan Laongmal wrote:
> dear all,
> I currently using postgresql v7.0.3
> when i import text file to table with command "copy tablename from
> '/tmp/a.txt';
> and it shows
> "copy: line 20, Cannot insert a duplicate key into unique index testpri_pk"
> ,then it exits with doing nothing.
>
> I wa
Hi all,
using PgSQL 7.0.3
I would like concatenate some fields to have all information in just
one field. I'm doing this below:
CREATE TABLE bill_2col AS
SELECT bill.bill_id,
(trim(text(bill.bill_number)) || ' | ' ||
trim(text(provider.company)) || ' | ' ||
trim(to_char(bill.issue_date,'M
Here is a method of filtering out the duplicate keys from the input file:
Let us assume that the input data is in /tmp/table.in, that that file is
tab-delimited and that the primary key is in field 2.
psql -d database -c "COPY table TO '/tmp/table.1'"
psql -d database -c "COPY table TO '
Amanda Riera wrote:
>I would like concatenate some fields to have all information in just
>one field. I'm doing this below:
>
>CREATE TABLE bill_2col AS
>SELECT bill.bill_id,
> (trim(text(bill.bill_number)) || ' | ' ||
> trim(text(provider.company)) || ' | ' ||
> trim(to_char(bi
Maybe a trivial question, maybe it's foreign from SQL, I'dont know...
How to add a column which stands for the row number in each row of the
result? E.g.:
row_no | column1 | column2 | ...
---+-+-+ ...
1 | datum11 | datum12 | ...
2 | datum21 | datum22 | ...
... |
Use the "serial" column type.
create table myTable (row_no serial,column1 varchar(10),column2
varchar(20));
HTH,
Poul L. Christiansen
On Wed, 11 Apr 2001, Kovacs Zoltan wrote:
> Maybe a trivial question, maybe it's foreign from SQL, I'dont know...
> How to add a column which stands for the row
I don't know if you've resolved your problem, but if not, you could try deleting and
recreating the indexes on the table...
Najm Hashmi wrote:
> Joel Burton wrote:
>
> > On Wed, 11 Apr 2001, Najm Hashmi wrote:
> >
> > > Hi All,
> > > From pgsql, I try to insert data in table using the \i com
> Use the "serial" column type.
Unfortunately it's not what I expect. Assume that I have an arbitrary
"SELECT expr1 as column1, expr2 as column2, ..." which gives
column1 | column2 | ...
+-+- ...
..data..
I would like to get the same res
I was searching for the same thing, I couldn't found it though :(
-Original Message-
From: Kovacs Zoltan [mailto:[EMAIL PROTECTED]]
Sent: woensdag 11 april 2001 16:37
To: Poul L. Christiansen
Cc: [EMAIL PROTECTED]
Subject: Re: [SQL] enumerating rows
> Use the "serial" column type.
Unfor
Kovacs Zoltan wrote:
>> Use the "serial" column type.
>Unfortunately it's not what I expect. Assume that I have an arbitrary
>"SELECT expr1 as column1, expr2 as column2, ..." which gives
>
>column1 | column2 | ...
>+-+- ...
>..data..
>.
> Here is a method which is fairly cumbersome, but will do what you want.
> (Whether what you want is useful, is another matter. The row numbers
> have no meaning except to delineate which row is printed after which; they
> bear no relation to their order in the table.)
Thanks, Oliver! Are you su
Hi all.
I have a table with about 5 million rows in it. I need to be able to get the
exact number of rows in the table at runtime. So I tried the following:
xxx=> explain select count(seed) from mytable;
NOTICE: QUERY PLAN:
Aggregate (cost=103152.27..103152.27 rows=1 width=4)
-> Seq Scan o
Gerald Gutierrez writes:
> I have a table with about 5 million rows in it. I need to be able to get the
> exact number of rows in the table at runtime. So I tried the following:
>
> xxx=> explain select count(seed) from mytable;
> NOTICE: QUERY PLAN:
>
> Aggregate (cost=103152.27..103152.27 row
Kovacs, Oliver,
First, thank you Oliver for the nice C program for this purpose. If
there doesn't turn out to be another method, it shoudl og in the
postgresql.org site.
However, Postgresql does have an internal row count for query results.
Otherwise LIMIT and OFFSET would not w
Kovacs Zoltan wrote:
>> Here is a method which is fairly cumbersome, but will do what you want.
>> (Whether what you want is useful, is another matter. The row numbers
>> have no meaning except to delineate which row is printed after which; they
>> bear no relation to their order in the t
On Wed, 11 Apr 2001, Kovacs Zoltan wrote:
> > Here is a method which is fairly cumbersome, but will do what you want.
> > (Whether what you want is useful, is another matter. The row numbers
> > have no meaning except to delineate which row is printed after which; they
> > bear no relation to th
Title: RE: [SQL] DB porting questions...
Hi, Jeff,
>> 1)
>> I have a table:
>> create table a (
>> t timestamp not null,
>> ...
>> );
>>
>> I'm thinking that I can define a.t as not null default=now(). But >> will
>> this
>> work? That is
Mike,
You'll be overjoyed to know that both of your questions have simple
answers.
> 1)
> I have a table:
> create table a (
> t timestamp not null,
> ...
> );
>
> I'm thinking that I can define a.t as not null default=now(). But
> will this
> work? That is, will it update a.t w
On Wed, 11 Apr 2001, Diehl, Jeffrey wrote:
> Hi all,
>
> I'm in the final stages of migrating from mysql to postgres and have a few
> more questions...
>
> 1)
> I have a table:
> create table a (
> t timestamp not null,
> ...
> );
>
> I'm thinking
Hi,
How can I do timezone conversions in PG? I looked on the docs and
couldn't find how. I want to find the current time in another timezone.
Thanks,
-Roberto
P.S: This type of function would be excellent on the cookbook
(www.brasileiro.net).
--
+| http://f
Hello All,
I have created a plSQL function with the "create function ..." which seems to
be ok and is just very simple.
I then wanted to load the function by:
psql -f test.sql -d trdata
which loads my function fine.
the problem is that I do not know how to call this function from the PLSQL
in
Lonnie,
It may be that you have not linked the PL/pgSQL language in Postgres.
It may be that you are putting a SELECT statement inside your function.
It is hard to tell, becuase I am unclear on the problem youa re having,
exactly. Here's some terminology to help clarify:
PL/pgSQL is the exten
23 matches
Mail list logo