On Tue, Sep 20, 2011 at 7:36 AM, Adrian Klaver wrote:
> On Monday, September 19, 2011 8:09:04 pm patrick keshishian wrote:
>> On Mon, Sep 19, 2011 at 6:08 PM, Adrian Klaver
> wrote:
>> > On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote:
>> >> Hi,
>> >>
>> >> Is there any way the
On Monday, September 19, 2011 8:09:04 pm patrick keshishian wrote:
> On Mon, Sep 19, 2011 at 6:08 PM, Adrian Klaver
wrote:
> > On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote:
> >> Hi,
> >>
> >> Is there any way the .sql scripts could make use of this query to get
> >> the fore
On Mon, Sep 19, 2011 at 8:34 PM, Tom Lane wrote:
> patrick keshishian writes:
>> The question wasn't where does one find the name of the constraint. My
>> example demonstrated that I knew how to get that value. The question,
>> however, is how do you get that in an ALTER TABLE statement?
>
> You'
2011/9/19 Ondrej Ivanič :
> Hi,
>
> On 20 September 2011 13:09, patrick keshishian wrote:
>> e.g., ALTER TABLE sales DROP CONSTRAINT (SELECT conname FROM
>> pg_constraint JOIN pg_class ON (conrelid=pg_class.oid) WHERE
>> pg_class.relname='sales' AND conkey[1] = 1 AND contype='f') ;
>
> You have to
patrick keshishian writes:
> The question wasn't where does one find the name of the constraint. My
> example demonstrated that I knew how to get that value. The question,
> however, is how do you get that in an ALTER TABLE statement?
You'd need to construct the ALTER statement as a string value
Hi,
On 20 September 2011 13:09, patrick keshishian wrote:
> e.g., ALTER TABLE sales DROP CONSTRAINT (SELECT conname FROM
> pg_constraint JOIN pg_class ON (conrelid=pg_class.oid) WHERE
> pg_class.relname='sales' AND conkey[1] = 1 AND contype='f') ;
You have to build query in different way:
psql
On Mon, Sep 19, 2011 at 6:08 PM, Adrian Klaver wrote:
> On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote:
>> Hi,
>>
>> Is there any way the .sql scripts could make use of this query to get
>> the foreign key name from pg_constraint table, regardless of PG
>> version (7.4.x or 9.x)
On Monday, September 19, 2011 5:10:45 pm patrick keshishian wrote:
> Hi,
>
>
>
> Is there any way the .sql scripts could make use of this query to get
> the foreign key name from pg_constraint table, regardless of PG
> version (7.4.x or 9.x)?
Use the information schema? As example:
http://www
Hi,
Where I work, we have a large deployment of software using PostgreSQL
database. We have been stuck on version 7.4.16 for a while now. I am
about to switch us to a 9.0.x.
One problem I'm running into, and I am hoping you can help me with,
given the constraints I have to work with, is our conve