Quoth pavel.steh...@gmail.com (Pavel Stehule):
> Dne 25.3.2013 23:51 "Ben Morrow" napsal(a):
> >
> > I would use a view for this:
> >
> > create view vale_any as
> > select 'P'::text "type", v.adiant, v.desc_per, v.cod
> &
Quoth c...@sygecom.com.br (Mauricio Cruz):
>
> I'm working in a PL/SQL and I'd like to use the same
> PL for 2 kinds of tables...
>
> I have "valepag" and "valerec" both tables
> have the same columns, but one is for debit and the other one is for
> credit, the PL will work for both cases
>
>
Quoth ja...@xnet.co.nz (Jasen Betts):
> On 2013-03-16, Victor Sterpu wrote:
> >
> > Is there a function that will give the resulting zip content for a=20
> > string?
> > Like SELECT zip('test data');?
>
> no. you could write one that calls gzip in one of the untrusted
> languages. or in C you co
Quoth jorgemal1...@gmail.com (JORGE MALDONADO):
>
> I am building an UPDATE query at run-time and one of the fields I want to
> include in the WHERE condition may repeat several times, I do not know how
> many.
>
> UPDATE table1
> SET field1 = "some value"
> WHERE (field2 = value_1 OR field2 = va
Quoth lists-pg...@useunix.net (Wayne Cuddy):
> On Thu, Feb 28, 2013 at 06:02:05PM +0000, Ben Morrow wrote:
> >
> > (If you wanted to you could instead rename the table, and use rules on
> > the view to transform DELETE to UPDATE SET state = 'deleted' and co
Quoth m...@summersault.com (Mark Stosberg):
>
> We are working on a project to start storing some data as "soft deleted"
> (WHERE state = 'deleted') instead of hard-deleting it.
>
> To make sure that we never accidentally expose the deleted rows through
> the application, I had the idea to use a
Quoth adrian.kla...@gmail.com (Adrian Klaver):
> On 02/25/2013 02:49 PM, mkumbale wrote:
> > Hi, I am new to PostgreSQL. I have an empty PostgreSQL DB containing tables
> > but no data. I issued the following command in PGADMIN SQL editor:
> >
> > CREATE DATABASE "NewDefault"
> >WITH OWNER =
Quoth parri...@gmail.com (Don Parris):
>
> Is it possible to use spaces in the ltree path, like so:
> TOP.Groceries.Food.Herbs & Spices
>
> Or do the elements of the path have to use underscores and dashes?
>From the docs:
| A label is a sequence of alphanumeric characters and underscores (for
At 12PM -0800 on 20/02/13 you (Sergey Konoplev) wrote:
> On Wed, Feb 20, 2013 at 10:16 AM, Ben Morrow wrote:
> >> If you got mixed up with plpgsql anyway what is the reason of making
> >> this WITH query constructions instead of implementing everything in a
> >> pl
At 8AM -0800 on 20/02/13 you (Sergey Konoplev) wrote:
> On Wed, Feb 20, 2013 at 12:19 AM, Ben Morrow wrote:
> > That's not reliable. A concurrent txn could insert a conflicting row
> > between the update and the insert, which would cause the insert to fail
> > with a u
Quoth gray...@gmail.com (Sergey Konoplev):
> On Sat, Feb 16, 2013 at 11:58 PM, Ben Morrow wrote:
> > WITH "exp" AS ( -- as before
> > ),
> > "subst" AS (
> > SELECT add_item(e.basket, e.nref, e.count)
> >
Quoth maps...@gmx.net (Andreas):
> Am 17.02.2013 19:20, schrieb Andreas Kretschmer:
> > Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> >> I need to store data that has a valid timespan with start and enddate.
> >>
> >> objects ( id, name, ... )
> >> object_data ( object_id referencs objec
Quoth adam.mailingli...@gmail.com (Adam):
>
> I have a rather complicated view that is dependent upon multiple
> tables, consisting of several windowing and aggregate functions, as
> well as some time intervals. I would like to be able to perform a
> function, i.e. pg_notify(), whenever a row is a
Quoth bier...@gmail.com (Bert):
>
> We continuously load data from flat files in our database.
> We first insert the data into unlogged tables (in the loadoltp schema), and
> then we use the 'upsert' statement to transfer the data from the load table
> into the tables we are going to use.
>
> The
Suppose I run the following query:
WITH "exp" AS (
DELETE FROM "item" i
USING "item_expired" e
WHERE e.oref = i.ref
AND i.basket= $1
RETURNING i.basket, e.oref, e.nref, i.count, e.msg
),
"subst" AS (
INSERT INTO "item" ("ba
Quoth jo...@jfcomputer.com (John):
> On Wednesday 07 July 2010 03:14:40 pm Justin Graf wrote:
> > I would be looking at the log files for the Inserts into that table as a
> > means to track down what is the cause. If there are no log files or
> > don't have enough detail, crank up the logging leve
Quoth andrew.ge...@gmail.com (Andrew Geery):
>
> I have a question about checking a constraint that is spread across multiple
> (in the example below, two) tables. In the example below, every food (food
> table) is in a food group (food_group table). For every person (person
> table), I want to
Is this behaviour expected? (This is with 8.4.3 on FreeBSD.)
create schema one;
set search_path to one;
create type foo as (x integer);
create function foo (integer) returns foo
language plpgsql as $$
declare
y foo;
begin
Quoth t...@sss.pgh.pa.us (Tom Lane):
> Ben Morrow writes:
> > I am trying to implement a fairly standard 'audit table' setup, but
> > using rules instead of triggers (since it should be more efficient).
>
> Rules are sufficiently tricky that I would never, ever re
I am trying to implement a fairly standard 'audit table' setup, but
using rules instead of triggers (since it should be more efficient).
However, I'm running into problems when one of the audited tables has a
'serial' column that is allowed to default:
create table foo (id serial, bar text);
Quoth junaidmali...@gmail.com (junaidmalik14):
>
> Is there any alternative of mysql function COUNT(DISTINCT expr,[expr...]) in
> postgres. We get error if we
>
> write count like this count(distinct profile.id, profile.name, profile.age)
> but it works well in mysql.
Pg does support COUNT(DIST
[quoting fixed]
Quoth dennis :
> Ben Morrow wrote:
> > Quoth dennis:
> >> Dear Ben
> >>
> >> thanks for you anwser.
> >> I try to add function quote_literal on my sql statement .
> >>
> >> but it raise other error message
Quoth dennis :
> Dear Ben
>
> thanks for you anwser.
> I try to add function quote_literal on my sql statement .
>
> but it raise other error message (quote_literal not support bytea format):
> function quote_literal(bytea) does not exist
Which Postgres version are you using?
Ben
--
Quoth dennis :
> Hi Ben
>
> here is my function , it's for fix missing chunk problem.
> It has same problem ,please take look
>
>
> thank for you help
>
> -table--
>
>
> db=# \d usersessiontable;
> Table "public.usersessiontable"
>Column |
Quoth dennis :
> here is example
>
> table name is "mail":
> column| type
> -
> sender|char
> subject |char
I presume you mean 'varchar'?
> content |bytea
>
>
> I want copy some record into new table 'mail_new'.
>
> sql:
> create table mail_new as select
Quoth dennis :
>
> I need to copy some data to new table.
> But I encounter some error message.
> the table structure
> Table A:
> c1 char
> c2 bytea
>
> Table B:
> c1 char
> c2 bytea
>
>
> My sql command:
> insert into B as select * from a where c1=xxx
'AS' isn't valid there.
26 matches
Mail list logo