Dear friends,
I am working opn Postgres 7.3.4 on RH Linux 7.2.
I wanted to disable constraints.
Alter table 'table name' disable constraint 'constraint name';
doesn't work.
I got some information from google, which says about indirect
way of disabling and enabling a constraint, as foll
Generally this is the task of various drivers.
The postgresql jdbc for instance makes this task
easy with the ResultSet.getBytes() method.
The servlet code to display the contents of any mimetype
bytea column looks like:
PreparedStatement st =
con.prepareStatement("select mimetype,image from im
Tom,
I'm running PostgreSQL 7.3.2 on Red Hat Linux 7.3 with 512Mb RAM.
The table definition is:
Table "public.cdr"
Column | Type | Modifiers
---+---+---
carrier_id| integer
On Tuesday 17 February 2004 18:08, you wrote:
> I'd recommend to let the application convert the binary
> data to and from base64,
Don't, please don't !
Since you have the good bytea rule to convert so called "binary" data into so
called "text". You have no need another encoding at all.
Genera
"David Witham" <[EMAIL PROTECTED]> writes:
> One of the customers is quite large (8.3% of the records):
Hmm. Unless your rows are quite wide, a random sampling of 8.3% of the
table would be expected to visit every page of the table, probably
several times. So the planner's cost estimates do not
Hi all,
This is a further post from last week. I've got a table of phone call detail records.
buns=# select count(*) from cdr;
count
-
2800653
(1 row)
One of the customers is quite large (8.3% of the records):
buns=# select count(*) from cdr where cust_id =
elein <[EMAIL PROTECTED]> writes:
> Apparently the ::char is cast to varchar and then text?
No, directly to text, because the || operator is defined as taking text
inputs. But there's no practical difference between text and varchar on
this point.
regards, tom lane
-
> select 'x'||' '||'x'
>
> should produce xx, but it produces x x.
>
INCORRECT
This
select 'x'||' '::char ||'x'
Should produce xx
This
select 'x'||' '||'x'
is restateable as select 'x'|| ' '::text ||'x'
And the || operand for text is not dropping the extra spaces hence correctly
x x
Terry Fie
"scott.marlowe" <[EMAIL PROTECTED]> writes:
> But then this:
> select 'x'||' '||'x'
> should produce xx, but it produces x x.
No, because the imputed type of those literals is text. You'd have to
cast the middle guy to char(n) explicitly to make its trailing spaces go
away when it's reconverted t
On Tue, 17 Feb 2004, Tom Lane wrote:
> elein <[EMAIL PROTECTED]> writes:
> > This is an example of the problem. It used to expand
> > the middle thing to 15.
>
> > elein=# select 'x' || ' '::char(15) || 'x';
> > ?column?
> > --
> > xx
> > (1 row)
>
> Still does, but then the spaces g
So the problem is there. But blaming it on char was wrong.
It should be blamed on the varchar change. Hey, I thought
the truncation was for varchar and not text? It was for both?
It would be semantically tricky to change the operator.
The precendence is to convert to text. Now with
the implicit
elein <[EMAIL PROTECTED]> writes:
> This is an example of the problem. It used to expand
> the middle thing to 15.
> elein=# select 'x' || ' '::char(15) || 'x';
> ?column?
> --
> xx
> (1 row)
Still does, but then the spaces go away again when the value goes into
the concatenation, bec
Richard Huxton <[EMAIL PROTECTED]> writes:
> 2. Write a custom aggregate function (like sum()) to do the concatenation.
> This is easy to do, but the order your ABC get processed in is undefined.
Actually, as of 7.4 it is possible to control the order of inputs to a
custom aggregate. You do some
This is an example of the problem. It used to expand
the middle thing to 15.
elein=# select 'x' || ' '::char(15) || 'x';
?column?
--
xx
(1 row)
On Tue, Feb 17, 2004 at 06:10:56PM -0500, Tom Lane wrote:
> "news.postgresql.org" <[EMAIL PROTECTED]> writes:
> > I just discovered the foll
"news.postgresql.org" <[EMAIL PROTECTED]> writes:
> I just discovered the following change to CHAR(n) (taken from varlena.com,
> general bits, issue 62).
The description you quote doesn't appear to have much of anything to do
with the actual behavior of 7.4.
7.4 will trim trailing spaces when con
On Tuesday 17 February 2004 20:05, [EMAIL PROTECTED] wrote:
> I should probably be punished for even asking this question, but a
> simplified version of what I want is this...
>
> I have 2 tables:
> floorplans
> floorplan_id | description
> --
> 2240 | test floorplan
On Tuesday 17 February 2004 14:41, Sumita Biswas (sbiswas) wrote:
> Is there nothing like SET NOCOUNT ON; in plpgsql
What is this supposed to do for you?
> Is there any option like SET ANSI_NULLS ON in plpgsql.
What is this supposed to do for you too?
> Do we append # before the temp table name
On Monday 16 February 2004 16:07, lowdog wrote:
> hey guys!
>
> I need your help in writing a php name-day searcher script.
Actually, you probably want a mysql list - this is a PostgreSQL list.
However, from what I can understand of your problem I think the easiest
solution for you might be to o
Jeremy Smith wrote:
On this subject, isn't it actually better to just store image names in the
database and pull the image itself from a directory? That's what I do on my
site because I didn't want to bloat up my database unnecessarily. Are there
additional benefits to storing the image informat
I should probably be punished for even asking this question, but a
simplified version of what I want is this...
I have 2 tables:
floorplans
floorplan_id | description
--
2240 | test floorplan
and a table elevations
floorplan_id | elevation
You've got it wrong when you reference the data column (a.x) -- your
foreign key should reference the primary key in the referenced table
(a.y)...
Besides, in your table A -- 1, 99 2, 99 violates your unique constraint
on column 'X' -- it would never happen...
What I suggested is like this:
c
hey guys! I need your
help in writing a php name-day searcher script. here's what ive done:
i have the hostname, login and pw defined in a file, this one calls it:
then i made the
query, where (sorry for not translating the variable names, would be easier for
you to understand )
the "nev
Thanks for the answer.
I have one more issue. How do I test a function that I wrote?
I was able to create a function called Proc_ConferenceSummary().
In SQL Server I used to run it through query analyzer by writing the
following command:
exec Proc_ConferenceSummary '12/1/2003','1/23/2004',1,1,0,500
New feature for posgreSQL 7.3 & later -- sequences are automatically dropped
when the owning table is dropped -- you need to recreate the sequence
The easiest way is in your CREATE TABLE tblName (
id serial PRIMARY KEY,
blah...,
blah...,
) WITH OIDS;
--
Greg Patnude / The Digit
Is there nothing like SET NOCOUNT ON; in plpgsql
Is there any option like SET ANSI_NULLS ON in plpgsql.
Do we append # before the temp table names in plpgsql, like we do for
MSSQL ? In case no how do we create a temp table in a function in plsql?
-Original Message-
From: Stephan Szabo [m
Hello,
I just discovered the following change to CHAR(n) (taken from varlena.com,
general bits, issue 62).
This will cause me serious heart-ache, back-ache and bug-ache if we upgrade
to 7.4. Is there any compatibility flag available to use pre-7.4 behaviour
for CHAR(n)?
Regards, John
==
Mark,
> I'm posting a function here in the hope others may find it useful
> and/or correct my mistakes/make improvements :)
Thanks! Way cool!
> Is there any existing site (a wiki for example) for posting PostgreSQL
> specific tips?
> (Wasn't sure if pgsql-sql is the right place for this ki
On this subject, isn't it actually better to just store image names in the
database and pull the image itself from a directory? That's what I do on my
site because I didn't want to bloat up my database unnecessarily. Are there
additional benefits to storing the image information in the database
Thanks...
--
--
Karl Denninger ([EMAIL PROTECTED]) Internet Consultant & Kids Rights Activist
http://www.denninger.netTired of spam at your company? LOOK HERE!
http://childrens-justice.orgWorking for family and children's rights
http://diversunion.org LOG IN AND GET YOUR TAN
Dnia 2004-02-17 17:02, Użytkownik Karl Denninger napisał:
I want to insert values from one table into another, and add some "default"
values (that are not defaults on the table different reasons - that is, this
is maintenance function and in normal operation there would be "real" values
there - and
[EMAIL PROTECTED]
On Tue, 17 Feb 2004, Karl Denninger wrote:
> I want to insert values from one table into another, and add some "default"
> values (that are not defaults on the table different reasons - that is, this
> is maintenance function and in normal operation there would be "real" values
beyaNet Consultancy wrote:
Hi,
what I am trying to do is to be able to store images in my database.
What I wanted to know is this:
1. Would it be better to have the image field type as a bytea or a
blob? I have heard it mentioned that bytea would be better as doing
data dumps would also insure
I want to insert values from one table into another, and add some "default"
values (that are not defaults on the table different reasons - that is, this
is maintenance function and in normal operation there would be "real" values
there - and null is valid)
So, I want to do, for example, the follow
Greg Patnude wrote:
Pleas also note that the referenced column in the foreign table either needs
to be the PRIMARY KEY or have a unique constraint on it or maybe it just
requires an index on it -- I'm not sure but I discovered that if the column
in the foreign table (containing the REFERENCED key..
On Tue, Feb 10, 2004 at 12:04:42PM +, beyaNet Consultancy wrote:
> Hi,
> can anyone tell me whether there is a trace facility (application)
> available for postgreSQL version 7.4.1 which will enable me to see all
> incoming requests being made to the database (ala SQL Server)?
Sure. Alter y
> Hello,
>I'm posting a function here in the hope others may find it useful
> and/or correct my mistakes/make improvements :)
>
> This creates a view of a remote table, using dblink:
...
> Is there any existing site (a wiki for example) for posting PostgreSQL
> specific tips?
The PG cookbook
36 matches
Mail list logo